public async Task <IActionResult> PutCarro(int id, Carro carro) { if (id != carro.CarroId) { return(BadRequest()); } _context.Entry(carro).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CarroExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutFabrica(int id, Fabrica fabrica) { if (id != fabrica.FabricaId) { return(BadRequest()); } _context.Entry(fabrica).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FabricaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }