public async Task <IActionResult> PutMenuItem(int id, MenuItem menuItem) { if (id != menuItem.Id) { return(BadRequest()); } _context.Entry(menuItem).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MenuItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }