public static void InitGlobalData(IApplicationBuilder applicationBuilder) { using (var serviceScope = applicationBuilder.ApplicationServices.GetRequiredService <IServiceScopeFactory>() .CreateScope()) { EduDbContext context = serviceScope.ServiceProvider.GetService <EduDbContext>(); StaticDataSrv.InitDbData(context); } }
private static void InitGlobalData() { StaticDataSrv.InitDbData(_dbContext); }