public ActionResult Delete(int id, IFormCollection collection) { if (InstructorRepository.DeleteInstructor(id)) { return(RedirectToAction(nameof(Index))); } else { return(RedirectToAction(nameof(Details), new { id = id })); } }
public ActionResult Delete(int id) { try { InstructorRepository.DeleteInstructor(id); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult DeleteConfirmed(int id) { try { InstructorRepository.DeleteInstructor(id); return(RedirectToAction(nameof(Index))); } catch { return(RedirectToAction(nameof(Details))); } }
public ActionResult Delete(int id, Instructor instructor) { InstructorRepository.DeleteInstructor(id, instructor); return(View(instructor)); }