예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
 public Food FindFood(int id)
 {
     return(foodsManager.Find(id));
 }