コード例 #1
0
 public static void InitGlobalData(IApplicationBuilder applicationBuilder)
 {
     using (var serviceScope = applicationBuilder.ApplicationServices.GetRequiredService <IServiceScopeFactory>()
                               .CreateScope())
     {
         EduDbContext context = serviceScope.ServiceProvider.GetService <EduDbContext>();
         StaticDataSrv.InitDbData(context);
     }
 }
コード例 #2
0
 private static void InitGlobalData()
 {
     StaticDataSrv.InitDbData(_dbContext);
 }