public async Task <IActionResult> PutRole(int id, Role role) { 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()); }
public async Task <IActionResult> PutAvailability(int id, Availability availability) { if (id != availability.Id) { return(BadRequest()); } _context.Entry(availability).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AvailabilityExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutOperator(int id, Operator @operator) { if (id != @operator.Id) { return(BadRequest()); } _context.Entry(@operator).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OperatorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutLocker(int id, Locker locker) { if (id != locker.IdNumber) { return(BadRequest()); } _context.Entry(locker).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LockerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }