public static void Seed(this IApplicationBuilder app) { Task.WaitAll( StatusSeeder.Seed(app.ApplicationServices.GetRequiredService <IStatusQueryRepository>()), PrioritySeeder.Seed(app.ApplicationServices.GetRequiredService <IPriorityQueryRepository>()) ); }
public static void Seed(this IServiceProvider sp) { using (var scope = sp.CreateScope()) { var services = scope.ServiceProvider; Task.WaitAll( StatusSeeder.Seed(services.GetRequiredService <IStatusQueryRepository>()), PrioritySeeder.Seed(services.GetRequiredService <IPriorityQueryRepository>()) ); } }