Updating how the migration works when swtching from docker run vs Visual Studio
This commit is contained in:
parent
3169a93344
commit
771d62a43a
@ -8,8 +8,15 @@ public class SeedData
|
|||||||
var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||||
|
|
||||||
await retryPolicy.ExecuteAsync(async () =>
|
await retryPolicy.ExecuteAsync(async () =>
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
await context.Database.MigrateAsync();
|
await context.Database.MigrateAsync();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
//If running on Docker on command line Migrations will take place automaticaly
|
||||||
|
}
|
||||||
|
|
||||||
var userMgr = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();
|
var userMgr = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();
|
||||||
var alice = await userMgr.FindByNameAsync("alice");
|
var alice = await userMgr.FindByNameAsync("alice");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user