public Startup(IConfiguration configuration) { Configuration = configuration; // recreate and seed the database // var InitDataProvider = new FileDataProvider("../init.csv"); using (var db = new TaxDB()){ db.Database.EnsureDeleted(); db.Database.EnsureCreated(); db.TaxPeriods.AddRange(InitDataProvider.GetAllTaxRecords().Select(x => { x.Created = DateTime.UtcNow; return(x); })); db.SaveChanges(); }; }