public async Task <ActionResult <VehiculoItem> > PostVehiculoItem(VehiculoItem item) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.VehiculoItems.Add(item); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetVehiculoItem), new { id = item.Placa }, item)); }
public async Task <IActionResult> PutVehiculoItem(string placa, VehiculoItem item) { if (placa != item.Placa) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }