How to have private constructors and private setters when using Entity Framework Core Database first

Having private constructors and private setters is one of the primary ways we can enforce encapsulation in our domain model. … Continue reading How to have private constructors and private setters when using Entity Framework Core Database first

Example of an Entity Framework Core Database First development workflow in a team environment

If you’re using Entity Framework Core with the Database First approach you may be looking for a suggested development workflow … Continue reading Example of an Entity Framework Core Database First development workflow in a team environment

An exception has been raised that is likely due to a transient failure when accessing an Azure SQL Database with Auto-pause on from Entity Framework Core

When you create an Azure SQL Database with the Serverless (pay per second of usage) pricing model there’s an auto-pause … Continue reading An exception has been raised that is likely due to a transient failure when accessing an Azure SQL Database with Auto-pause on from Entity Framework Core

The term ‘Scaffold-DbContext’ is not recognized as the name of a cmdlet, function, script file, or operable program.

If you’re trying to scaffold a database in Entity Framework Core for the first time in your project you might … Continue reading The term ‘Scaffold-DbContext’ is not recognized as the name of a cmdlet, function, script file, or operable program.

Fix the ‘Unable to resolve service for type Microsoft EntityFrameworkCore DbContext’ error after scaffolding an MVC Controller in Visual Studio

If you’ve got this error after scaffolding a controller which uses Entity Framework Core like below… it means you haven’t … Continue reading Fix the ‘Unable to resolve service for type Microsoft EntityFrameworkCore DbContext’ error after scaffolding an MVC Controller in Visual Studio

Using split queries (AsSplitQuery) in Entity Framework Core to avoid the cartesian explosion problem

Without lazy loading in Entity Framework Core we must eagerly load related entities which means we can experience the ‘cartesian … Continue reading Using split queries (AsSplitQuery) in Entity Framework Core to avoid the cartesian explosion problem