public async Task <IActionResult> PutProductOrders(int id, ProductOrders productOrders) { if (id != productOrders.ID) { return(BadRequest()); } _context.Entry(productOrders).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductOrdersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCustomer(int id, Customer customer) { customer.ID = id; if (id != customer.ID) { return(BadRequest()); } _context.Entry(customer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutRole(int id, Role role) { role.ID = id; if (id != role.ID) { return(BadRequest()); } _context.Entry(role).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }