public async Task <ActionResult <VehiclePartsData> > PostVehiclePartsData(VehiclePartsData vehiclePartsData)
        {
            _context.VehiclePartsData.Add(vehiclePartsData);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetVehiclePartsData", new { id = vehiclePartsData.VehicleId }, vehiclePartsData));
        }
        public async Task <IActionResult> PutVehiclePartsData(int id, VehiclePartsData vehiclePartsData)
        {
            if (id != vehiclePartsData.VehicleId)
            {
                return(BadRequest());
            }

            _context.Entry(vehiclePartsData).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VehiclePartsDataExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }