public async Task <ActionResult <VehiculoDetail> > PostVehiculoDetail(VehiculoDetail vehiculoDetail) { _context.VehiculoDetails.Add(vehiculoDetail); await _context.SaveChangesAsync(); return(CreatedAtAction("GetVehiculoDetail", new { id = vehiculoDetail.VHid }, vehiculoDetail)); }
public async Task <IActionResult> PutVehiculoDetail(int id, VehiculoDetail vehiculoDetail) { if (id != vehiculoDetail.VHid) { return(BadRequest()); } _context.Entry(vehiculoDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VehiculoDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }