public static void EmptyDB(this HOHSIContext context) { context.Database.EnsureDeleted(); //context.Database.EnsureCreated(); context.Database.Migrate(); //EnsureDBSeeded(context); }
public static void EnsureDBSeeded(this HOHSIContext context) { if (!context.Exercises.Any()) { context.AddRange(new Exercise[] { new Exercise() { Name = "Fully open", Description = "Try to fully open your hand", ImageName = "/img/no-image.jpg" }, new Exercise() { Name = "Fully close", Description = "Try to fully close your hand", ImageName = "/img/no-image.jpg" } }); context.SaveChanges(); } }