public ActionResult Edit(Dish dish) { if (ModelState.IsValid) { db.Entry(dish).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dish)); }
public ActionResult Edit([Bind(Include = "Id,Name")] DishCategory dishCategory) { if (ModelState.IsValid) { db.Entry(dishCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dishCategory)); }
public ActionResult Edit([Bind(Include = "Id,DateTime,Summ,NumberOfSpentBonuses,Total")] Order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(order)); }
public ActionResult Edit([Bind(Include = "Id,Name,Surname,Patronymic,PhoneNumber,Password,Email,DiscountInPercent,TotalSpentMoney")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public void Update(T entity) { _context.Entry(entity).State = EntityState.Modified; Save(); }