public RegisteredStudent Delete(DeletedStudent deletedStudent) { using (SchoolDataContext schoolContext = new SchoolDataContext()) { Student studentToDelete = (Student)schoolContext.Students.Where(b => b.Id == deletedStudent.Id).First(); schoolContext.Entry(studentToDelete).State = System.Data.Entity.EntityState.Deleted; schoolContext.SaveChanges(); return(studentToDelete.toDTO()); } }
public RegisteredStudent Delete(DeletedStudent deletedStudent) { return(this._studentService.Delete(deletedStudent)); }