public async Task <IActionResult> PutInvestigativeReport([FromRoute] int id, [FromBody] InvestigativeReport investigativeReport) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != investigativeReport.ReportID) { return(BadRequest()); } _context.Entry(investigativeReport).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InvestigativeReportExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutOfficer([FromRoute] int id, [FromBody] Officer officer) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != officer.OfficerID) { return(BadRequest()); } _context.Entry(officer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OfficerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }