// GET: Orders/Details/5 public ActionResult Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Order order = db.Orders.Find(id); var orderDetailDao = new OrderDetailDao(); ViewBag.TakeOrderDetail = orderDetailDao.TakeOrderDetail(id); if (order == null) { return(HttpNotFound()); } return(View(order)); }