forked from SoDOff-Project/sodoff
revert Program.cs
This commit is contained in:
parent
423eb7bc31
commit
d47acbbbb2
@ -20,11 +20,7 @@ builder.Services.AddControllers(options => {
|
|||||||
options.OutputFormatters.RemoveType<HttpNoContentOutputFormatter>();
|
options.OutputFormatters.RemoveType<HttpNoContentOutputFormatter>();
|
||||||
options.Filters.Add<LogRequestOnError>();
|
options.Filters.Add<LogRequestOnError>();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (builder.Environment.IsDevelopment())
|
|
||||||
builder.Services.AddDbContext<DBContext>();
|
builder.Services.AddDbContext<DBContext>();
|
||||||
else
|
|
||||||
builder.Services.AddDbContext<ProductionDBContext>();
|
|
||||||
|
|
||||||
// create Modding Service singleton here ... do this before start http server to avoid serve invalid assets list
|
// create Modding Service singleton here ... do this before start http server to avoid serve invalid assets list
|
||||||
builder.Services.AddSingleton<ModdingService>(new ModdingService());
|
builder.Services.AddSingleton<ModdingService>(new ModdingService());
|
||||||
@ -67,10 +63,7 @@ var app = builder.Build();
|
|||||||
|
|
||||||
using var scope = app.Services.CreateScope();
|
using var scope = app.Services.CreateScope();
|
||||||
|
|
||||||
if (app.Environment.IsDevelopment())
|
|
||||||
scope.ServiceProvider.GetRequiredService<DBContext>().Database.Migrate();
|
scope.ServiceProvider.GetRequiredService<DBContext>().Database.Migrate();
|
||||||
else
|
|
||||||
scope.ServiceProvider.GetRequiredService<ProductionDBContext>().Database.Migrate();
|
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user