Пример #1
0
 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());
     }
 }
Пример #2
0
 public RegisteredStudent Delete(DeletedStudent deletedStudent)
 {
     return(this._studentService.Delete(deletedStudent));
 }