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>(); } }
public CoffeeSeeder(SeederConfigurationData seederData, CoffeeDb db) { this.seederData = seederData; this.db = db; }