public async Task <ActionResult <FmVehicle> > PostFmVehicle(FmVehicle fmVehicle) { _context.FmVehicles.Add(fmVehicle); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFmVehicle", new { id = fmVehicle.Id }, fmVehicle)); }
public async Task <IActionResult> PutFmVehicle(int id, FmVehicle fmVehicle) { if (id != fmVehicle.Id) { return(BadRequest()); } _context.Entry(fmVehicle).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FmVehicleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }