revert Program.cs

This commit is contained in:
Alan Moon 2025-03-19 12:23:02 -07:00
parent 423eb7bc31
commit d47acbbbb2

View File

@ -20,11 +20,7 @@ builder.Services.AddControllers(options => {
options.OutputFormatters.RemoveType<HttpNoContentOutputFormatter>();
options.Filters.Add<LogRequestOnError>();
});
if (builder.Environment.IsDevelopment())
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
builder.Services.AddSingleton<ModdingService>(new ModdingService());
@ -67,10 +63,7 @@ var app = builder.Build();
using var scope = app.Services.CreateScope();
if (app.Environment.IsDevelopment())
scope.ServiceProvider.GetRequiredService<DBContext>().Database.Migrate();
else
scope.ServiceProvider.GetRequiredService<ProductionDBContext>().Database.Migrate();
// Configure the HTTP request pipeline.