/// <summary> /// Initialise les données de l'application /// </summary> /// <param name="app">App builder</param> /// <param name="configuration">Configuration</param> /// <returns><paramref name="app"/></returns> public static IServiceProvider SeedData(this IServiceProvider services) { SandBoxDbContext applicationContext = services.GetRequiredService <SandBoxDbContext>(); var seed = new SandBoxSeed(applicationContext, services); seed.Run().Wait(); return(services); }
public SandBoxSeed(SandBoxDbContext context, IServiceProvider services) { Context = context; _services = services; _logger = services.GetService <ILogger <SandBoxSeed> >(); }