public ActionResult DeleteSubject(int id) { var subjectModelFromRepo = _repository.GetById(id); if (subjectModelFromRepo == null) { return(NotFound()); } _repository.Delete(subjectModelFromRepo); _repository.SaveChanges(); return(NoContent()); }
public ActionResult DeleteCourse(int id) { var courseModelFromRepo = _repository.GetById(id); if (courseModelFromRepo == null) { return(NotFound()); } _repository.Delete(courseModelFromRepo); _repository.SaveChanges(); return(NoContent()); }