Exemplo n.º 1
0
 public static void AddSeeder(this IServiceCollection services, IHostingEnvironment environment, IConfiguration configuration)
 {
     if (environment.IsDevelopment())
     {
         var seederData = new SeederConfigurationData();
         configuration.Bind("Seeder", seederData);
         services.AddSingleton(typeof(SeederConfigurationData), seederData);
         services.AddTransient <CoffeeSeeder>();
     }
 }
Exemplo n.º 2
0
 public CoffeeSeeder(SeederConfigurationData seederData, CoffeeDb db)
 {
     this.seederData = seederData;
     this.db         = db;
 }