public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var machine = service.GetMachine(id); if (machine == null) { return(HttpNotFound()); } return(View(machine)); }