Exemplo n.º 1
0
 public static void EmptyDB(this HOHSIContext context)
 {
     context.Database.EnsureDeleted();
     //context.Database.EnsureCreated();
     context.Database.Migrate();
     //EnsureDBSeeded(context);
 }
Exemplo n.º 2
0
 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();
     }
 }