apikey.creationdate

This commit is contained in:
Paul Schneider 2021-05-09 01:52:46 +01:00
commit bb02706773
5 changed files with 47 additions and 10 deletions

View file

@ -60,7 +60,8 @@ namespace nuget_host
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IHostingEnvironment env)
public void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IHostingEnvironment env,
ApplicationDbContext dbContext)
{
if (env.IsDevelopment())
{
@ -73,12 +74,7 @@ namespace nuget_host
app.UseHsts();
try
{
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>()
.CreateScope())
{
serviceScope.ServiceProvider.GetService<ApplicationDbContext>()
.Database.Migrate();
}
dbContext.Database.Migrate();
}
catch (TargetInvocationException ex)
{