apikey.creationdate
This commit is contained in:
parent
915736c4e2
commit
bb02706773
5 changed files with 47 additions and 10 deletions
10
Startup.cs
10
Startup.cs
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue