-
-
Save caseyspaulding/5e621fe3ab762d08d9ddc8c711a824a8 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
public static class DataHelper | |
{ | |
public static async Task ManageDataAsync(IServiceProvider svcProvider) | |
{ | |
//Service: An instance of db context | |
var dbContextSvc = svcProvider.GetRequiredService<ApplicationDbContext>(); | |
//Migration: This is the programmatic equivalent to Update-Database | |
await dbContextSvc.Database.MigrateAsync(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment