public async Task <IActionResult> PutUsuario(int id, Usuario usuario) { if (id != usuario.IdUsuario) { return(BadRequest()); } _context.Entry(usuario).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuarioExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutRole(int id, Role role) { if (id != role.IdRol) { return(BadRequest()); } _context.Entry(role).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }