public ActionResult Edit(int?id) { if (id == null) { return(StatusCode(400)); } foods food = _foodManager.Find(x => x.id == id.Value); ViewBag.Categories = _categoryManager.List(); if (food == null) { return(StatusCode(404)); } return(View(food)); }
public ActionResult FoodPage(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Food food = foodManager.Find(x => x.Id == id); if (food == null) { return(HttpNotFound()); } return(View(food)); }
public Food FindFood(int id) { return(foodsManager.Find(id)); }