public static void Intialize(IkmeDbContext context) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); if (!context.Plans.Any()) { LoadTestPlans(context); LoadTestFuels(context); context.SaveChanges(); } }
private static void LoadTestFuels(IkmeDbContext context) { Fuel sun = new Fuel() { Name = "Sun", Price = .01, Capacity = 10000, Stability = .02 }; Fuel wind = new Fuel() { Name = "Wind", Price = .02, Capacity = 10000, Stability = .08 }; Fuel nuclear = new Fuel() { Name = "Nuclear", Price = .03, Capacity = 10000, Stability = .5 }; Fuel biomassa = new Fuel() { Name = "Biomassa", Price = .04, Capacity = 10000, Stability = .1 }; Fuel steg = new Fuel() { Name = "Steg", Price = .05, Capacity = 10000, Stability = .3 }; context.Fuels.Add(sun); context.Fuels.Add(wind); context.Fuels.Add(nuclear); context.Fuels.Add(biomassa); context.Fuels.Add(steg); context.SaveChanges(); }