forked from SoDOff-Project/sodoff
dont add development dbcontext to services if in production
This commit is contained in:
parent
51ead169e8
commit
423eb7bc31
@ -20,8 +20,11 @@ builder.Services.AddControllers(options => {
|
|||||||
options.OutputFormatters.RemoveType<HttpNoContentOutputFormatter>();
|
options.OutputFormatters.RemoveType<HttpNoContentOutputFormatter>();
|
||||||
options.Filters.Add<LogRequestOnError>();
|
options.Filters.Add<LogRequestOnError>();
|
||||||
});
|
});
|
||||||
builder.Services.AddDbContext<DBContext>();
|
|
||||||
builder.Services.AddDbContext<ProductionDBContext>();
|
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
|
// 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());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user