Is it possible to have my ASP Core Web API ensure the DB is migrated to the latest migration using EF Core? I know this can be done through the command line, but I want to
This code works in .NET core 3.0
using (var scope = app.ApplicationServices.CreateScope()) { var dbContext = scope.ServiceProvider.GetService(); dbContext.Database.Migrate(); }