public async Task <IActionResult> PutWorker(Guid id, Worker worker) { if (id != worker.WorkerId) { return(BadRequest()); } _context.Entry(worker).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WorkerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutBranch(Guid id, Branch branch) { if (id != branch.BranchId) { return(BadRequest()); } _context.Entry(branch).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BranchExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }