public async Task <IActionResult> PutPizza(int id, Models.Pizza pizza) { if (id != pizza.IdPizza) { return(BadRequest()); } _context.Entry(pizza).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PizzaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutAdmin(int id, Admin admin) { if (id != admin.IdAdmin) { return(BadRequest()); } _context.Entry(admin).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdminExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutOrder(int id, Order order) { if (id != order.IdOrder) { return(BadRequest()); } _context.Entry(order).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrderExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutIngredient(int id, Ingredient ingredient) { if (id != ingredient.IdIngredient) { return(BadRequest()); } _context.Entry(ingredient).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IngredientExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }