Map private fields in Entity framework core

In DDD you always want to control what is being put into your domain object. That can be done with public getters and private setters. But when it comes to collections (e.g. System.Collections.Generic.List<T>) it becomes more complicated, due to the fact the the domain object exposes an object of type List<T> which can be modified.

Continue Reading “Map private fields in Entity framework core”

Testing DBContext migrations

Today i was creating EntityFrameworkCore DBContexts and it’s a time consuming work to delete the databases, add migrations and then update the database to see what the migration scripts would generate.

I created a simple powershell-script that i ran when needed.

To find the instance pipe name of the LocalDB i used the sqllocaldb utility.