public static void SeedData(StudentsContext context)
 {
     if (!context.Students.Any())
     {
         context.Students.Add(new Student
         {
             FirstName  = "Ahmed",
             LastName   = "Sherien",
             NationalId = "1122334455667788",
             Email      = "*****@*****.**"
         });
         context.SaveChanges();
     }
 }
예제 #2
0
 public static void InitializeDatabase(StudentsContext context)
 {
     context.Database.Migrate();
 }