// GET: Customers/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var result = customer.GetSingle(x => x.Id == id); if (result == null) { return(HttpNotFound()); } return(View(result)); }