// GET: Meals/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Meal meal = _dairyFarmService.GetMealById(id); if (meal == null) { return(HttpNotFound()); } return(View(meal)); }