// GET: Students1/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Student student = service.GetStudentById(id.Value); if (student == null) { return(HttpNotFound()); } return(View(student)); }
public async Task <ActionResult <Student> > GetStudentById(long id) { return(await _studentsService.GetStudentById(id)); }