public async Task <IActionResult> PutCliente(int id, Cliente cliente) { if (id != cliente.ClienteId) { return(BadRequest()); } _context.Entry(cliente).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClienteExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutProducto(int id, Producto producto) { if (id != producto.ProductoId) { return(BadRequest()); } _context.Entry(producto).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }