public async Task <ActionResult <CarInspection> > PostCarInspection(CarInspection carInspection) { _context.CarInspections.Add(carInspection); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCarInspection", new { id = carInspection.CarInspectionID }, carInspection)); }
public async Task <IActionResult> PutCarInspection(int id, CarInspection carInspection) { if (id != carInspection.CarInspectionID) { return(BadRequest()); } _context.Entry(carInspection).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CarInspectionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }