初始化db新增配置是否启动

This commit is contained in:
不做码农
2022-07-01 22:39:39 +08:00
parent f3b417a522
commit 6c31771605
3 changed files with 9 additions and 2 deletions

View File

@@ -81,8 +81,12 @@ builder.Services.AddMvc(options =>
builder.Services.AddSwaggerConfig();
var app = builder.Build();
//InternalApp.ServiceProvider = app.Services;
//app.Services.InitDb();
if (builder.Configuration["InitDb"].ParseToBool() == true)
{
InternalApp.ServiceProvider = app.Services;
app.Services.InitDb();
}
app.UseSwagger();
//使可以多次多去body内容