// GET: Students/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } Student student = await studentService.GetStudentAsync(id.GetValueOrDefault()); if (student == null) { return(NotFound()); } ViewBag.StudentId = id; return(View(student)); }
// GET: Student/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Student student = await studentService.GetStudentAsync(id.GetValueOrDefault()); if (student == null) { return(HttpNotFound()); } ViewBag.StudentId = id; return(View(student)); }