Skip to content

Commit

Permalink
Ensure that the database is created. Fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
dodyg committed Feb 24, 2021
1 parent 3690b37 commit f0368e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions projects/security/authentication-with-identity/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
endpoints.MapDefaultControllerRoute();
});

var context = app.ApplicationServices.GetService<ApplicationDbContext>();
using (var client = context)
{
client.Database.EnsureCreated();
}
}
}
}

0 comments on commit f0368e6

Please sign in to comment.