public static void Migrate(IApplicationBuilder app) { using (var serviceScope = app.ApplicationServices.GetRequiredService <IServiceScopeFactory>().CreateScope()) { using (WpWhDbContext context = serviceScope.ServiceProvider.GetService <WpWhDbContext>()) { context.Database.Migrate(); } } }
public BaseRepository(WpWhDbContext context) { Context = context; }