public IActionResult UpdateDish(Dish fromForm, int DishId) { fromForm.DishId = DishId; _context.Update(fromForm); _context.Entry(fromForm).Property("CreatedAt").IsModified = false; _context.SaveChanges(); return(RedirectToAction("DishInfo")); }
public async Task <IActionResult> PutDish(long id, Dish item) { if (id != item.Id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
public void Update(Dish dish) { db.Entry(dish).State = EntityState.Modified; }