예제 #1
0
        /// <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);
        }
예제 #2
0
 public SandBoxSeed(SandBoxDbContext context, IServiceProvider services)
 {
     Context   = context;
     _services = services;
     _logger   = services.GetService <ILogger <SandBoxSeed> >();
 }