public async Task <IActionResult> PutEmpleado(int id, Empleado empleado) { if (id != empleado.Id) { return(BadRequest()); } _context.Entry(empleado).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmpleadoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCliente(int id, Cliente cliente) { if (id != cliente.Id) { 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> PutPerson(int id, [FromBody] Persona persona) { if (id != persona.Id) { return(BadRequest()); } _context.Entry(persona).State = EntityState.Modified; await _context.SaveChangesAsync(); return(Ok()); }