v1.0.9
This commit is contained in:
@@ -75,11 +75,21 @@ namespace CC.Yi.API
|
||||
}).AddEntityFrameworkStores<DataContext>().AddDefaultTokenProviders();
|
||||
}
|
||||
|
||||
private void InitData(IServiceProvider serviceProvider)
|
||||
{
|
||||
var serviceScope = serviceProvider.GetRequiredService<IServiceScopeFactory>().CreateScope();
|
||||
|
||||
var context = serviceScope.ServiceProvider.GetService<DataContext>();
|
||||
DbContentFactory.Initialize(context);//<2F><><EFBFBD>þ<EFBFBD>̬<EFBFBD><EFBFBD><E0B7BD>ע<EFBFBD><D7A2>
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
@@ -99,6 +109,7 @@ namespace CC.Yi.API
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
InitData(app.ApplicationServices);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user