public async Task <IActionResult> PutAccidentReportRecords(Guid id, AccidentReportRecords accidentReportRecords) { if (id != accidentReportRecords.Id) { return(BadRequest()); } _context.Entry(accidentReportRecords).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AccidentReportRecordsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <AccidentReportRecords> > PostAccidentReportRecords(AccidentReportRecords accidentReportRecords) { _context.AccidentReportRecords.Add(accidentReportRecords); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAccidentReportRecords", new { id = accidentReportRecords.Id }, accidentReportRecords)); }