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; }
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; }
public Student Classgroup_Delete(Student obj) { Student student = db.Students.SingleOrDefault(o => o.ID == obj.ID); db.Students.Remove(student); db.SaveChanges(); return student; }