public async Task <IActionResult> PutCompany(int id, Company company) { if (id != company.Id) { return(BadRequest()); } _context.Entry(company).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompanyExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutRegulation(int id, Regulation regulation) { if (id != regulation.Id) { return(BadRequest()); } _context.Entry(regulation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RegulationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutGroupCrossReference(int id, GroupCrossReference groupCrossReference) { if (id != groupCrossReference.Id) { return(BadRequest()); } _context.Entry(groupCrossReference).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GroupCrossReferenceExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutServer(int id, Server server) { if (id != server.Id) { return(BadRequest()); } _context.Entry(server).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ServerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }