public bool AddEmployee(Student Student)
 {
     try{
         context.Add(Student);
         context.SaveChanges();
         return(true);
     }
     catch {
         return(false);
     }
 }
Пример #2
0
 public static void PopulateTestData(AppIMDBContext dbContext)
 {
     //dbContext.student.Add(new Student("Wayne", "Gretzky", 183, 84, new DateTime(1961,1,26)) { Id = 1, Created = DateTime.UtcNow });
     dbContext.stud.Add(new Student()
     {
         Name       = "Test",
         Gender     = "F",
         Department = "C",
         City       = "C"
     });
     dbContext.SaveChanges();
 }