Ejemplo n.º 1
0
 private static void Upadte(int id, string newEmail, string newName)
 {
     using (Applivationdb db = new Applivationdb())
     {
         Student stu = db.Students.Find(id);
         stu.Name  = newName;
         stu.Email = newEmail;
         db.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public static void Create(string name, string email)
 {
     using (Applivationdb db = new Applivationdb())
     {
         Student student = new Student()
         {
             Name = name, Email = email
         };
         db.Students.Add(student);
         db.SaveChanges();
     }
 }