Blog: 2018 March

If you use Entity Framework Core with migrations in your ASP.NET Core application and want to ensure that the database structure always matches the currently running application, you can simply migrate the database on application startup. This way you just have to redeploy your application and everything like migrating the data, change the schemas, etc. is done when the application is restarted. To do an automatic migration, register your DbContext implementation in the ASP.NET Core’s dependency injection system – the same way as it is already recommended by Microsoft. Because there is no active injection scope in the Configure() method, […] Read more...