// GET: Orders/Details/5 public ActionResult Details(int?id) { #region EF6 Code //if (id == null) //{ // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); //} //Order order = db.OrderSet.Find(id); //if (order == null) //{ // return HttpNotFound(); //} //return View(order); #endregion if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Order order = _repo.GetOrderWithCustomerAndGlasses(id.Value); if (order == null) { return(HttpNotFound()); } return(View(order)); }