Created
November 6, 2019 00:23
-
-
Save IntegerMan/2483582129bca949ef107bdf352b2e87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void ApplyDatabaseMigrations(IApplicationBuilder app) | |
{ | |
using var scope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope(); | |
scope.ServiceProvider.GetRequiredService<ApplicationDbContext>().Database.Migrate(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment