public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var vm = repo.GetDetailsStudentViewModel(id.Value); if (vm == null) { return(HttpNotFound()); } return(View(vm)); }