Exemple #1
0
 public Student Classgroup_Edit(Student obj)
 {
     db.Entry(obj).State = EntityState.Modified;
     db.SaveChanges();
     obj = db.Students.SingleOrDefault(o => o.ID == obj.ID);
     return obj;
 }
Exemple #2
0
 public Student Student_Create(Student obj)
 {
     obj.ID = Guid.NewGuid();
     db.Students.Add(obj);
     db.SaveChanges();
     obj = db.Students.FirstOrDefault(o => o.ID == obj.ID);
     return obj;
 }
Exemple #3
0
 public Student Classgroup_Delete(Student obj)
 {
     Student student = db.Students.SingleOrDefault(o => o.ID == obj.ID);
     db.Students.Remove(student);
     db.SaveChanges();
     return student;
 }