public ActionResult Edit(MealModel mm) { if (Session["UserID"] != null && Session["UserType"].ToString().ToLower() == "chef") { if (mm != null) { Meal mU = mRepo.GetByID(mm.ID); mU.Name = mm.Name; mU.PhotoPath = mm.PhotoPath; mU.Price = mm.Price; mU.Stock = mm.Quantity; mU.Description = mm.Description; mRepo.Update(mU); return(RedirectToAction("Index", "Chef")); } } return(RedirectToAction("Login", "Home", new { area = "" })); }
public ActionResult <Meal> Put(int id, Meal entity) { _repository.Update(id, entity); return(Ok(entity)); }