Posts


Other Views: By Month | By Category | By Tag Cloud


Get NDI working with OBS 29 on Apple Silicon

I just got a Mac Mini M2 and needed to get OBS 29 (latest version) working with NDI but no matter what I did I kept getting the following error everytime I started OBS.

OBS NDI Error on Startup Missing NDI Runtime

Read More


How to Completely Uninstall OBS on Mac

As part of troubleshooting why on my Mac Mini M2 NDI was not workign with OBS, I needed to completely uninstall OBS (application, plugins, configurations, etc) so that there was no traces of OBS on the system and then re-install OBS.

Read More


EF Core - Configurations That Apply to All Tables

In our previous post, we split all of the entity configurations by table into their own configuration mapping file. The next step is to create a base class that all of the configuration mappings inherit from where we can put configurations that all entities should get.

An example of where we will use the global configuration is the soft deletes that we implement previously where we want to exclude all of the rows that have the IsDeleted flag set to true but we do not want to have to remember to add that code to all of the entities and we don’t want to have to remember to add it to every query.

Read More


EF Core - Split Model Configuration Into Files By Table

With EF Core, you configure your entities (e.g. tables) using the OnModelCreating in your database context. It is easy to just put all of the configurations into that OnModelCreating method which for just a few entities works great. However, as the number of entities grows, OnModelCreating easily becomes unwieldy with thousands of lines of configuration code.

In this post, I am going to show you how you can move the configuration for each of your entities to it’s own file and just have to put a single line of code in the OnModelCreating for each entity. This will greatly simplify the management and maintenance of the entity configuration code.

Read More


EF Core - Use Enum as Column Value

When dealing with databases, there are times when you want a column to only allow certain values. When using EF Core, the easiest way to accomplish this goal is to use an enum as the type for the property.

In this post, we will add a new column to an entity that is of an enum type, set the default value, and create the migration script.

Read More


EF Core - Audit Fields - Track Created By and Last Updated By Values Automatically

In several applications I work on, in addition to the soft deletes that we implemented in the previous post, we also have a requirement to implement audit tracking. Audit tracking is the tracking of who created the record, the date the record was created, who was the last person to update the record, and the last updated date of the record.

In this post, we will implement audit tracking so that the audit fields are automatically added onto our entities and EF Core automatically sets the values when save our entity.

Read More


EF Core - Implement Soft Delete

In several applications I work on, we have a requirement that we are not allowed to delete any data out of the database physically. Instead, when we need to delete a record, we set an IsDeleted column to true and exclude the row from our queries.

In this post, we will be implementing soft deletes on an example project.

Read More


ASP.NET Core - AutoMapper - Handle When Property Names Are Not Same Between Objects

So far in our AutoMapper series all of the property names between the input and output objects have been the same. There are times though that the property names will not match and you will need to tell AutoMapper how to map the properties else the configuration will not be valid.

In this post, we will take a look at the AutoMapper configuration need to map between property names that do not match.

Read More


ASP.NET Core - AutoMapper - Test Mapping Configuration

In our previous post, we used AutoMapper to convert from a entity to a view model. In our example code, it only works as expected in happy path mode where the configuration is valid and there is no way to know the configuration is not valid until we run the application.

In this post, we are going to look at how with just a few lines of code, we can write a unit test to validate our AutoMapper mapping profile.

Read More


ASP.NET Core - AutoMapper - Easily Convert One Object to Another

Mapping code is boring. Testing mapping code is even more boring.

AutoMapper is a simple library built to map one object to another and takes out all of the fuss of mapping one object to another.

In this post, we will create a sample ASP.NET Core API project, install and wire up AutoMapper, and update the sample Weather Forecast Controller to return a view model that was converted from our concrete object to a view model object.

Read More