public ActionResult DeleteConfirmed(int id) { try { _professorRepository.Remove(id); return(RedirectToAction("Index")); } catch (InvalidOperationException IEx) { TempData["Error"] = IEx.Message; return(View()); } }
public int Remove(Professor professor) { var rep = new ProfessorRepository(new DatabaseFactory()); return(rep.Remove(professor)); }