public async Task <IActionResult> Get(int id) { var instructor = await _instructorRepository.GetInstructor(id); if (instructor == null) { return(new NotFoundResult()); } return(new ObjectResult(instructor)); }
public IActionResult Update(int id) { var instructor = _instructorRepository.GetInstructor(id); if (instructor == null) { return(NotFound()); } return(View(instructor)); }
// GET: Instructor/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var instructor = instructorRepository.GetInstructor((int)id); if (instructor == null) { return(HttpNotFound()); } return(View(instructor)); }
public ActionResult Details(int id) { var instructor = instructorRepository.GetInstructor(id); return(View(instructor)); }