public void EditRole(SystemRole role) { var original = rolesRepository.GetById(r => r.RoleId == role.RoleId); Role dbRole = rolesRepository.GetById(r => r.RoleId == role.RoleId); dbRole.RoleName = role.RoleName; rolesRepository.Update(original, dbRole); }
public async Task <IHttpActionResult> GetById(int Id) { try{ log.Info(new MDCSet(this.ControllerContext.RouteData), new InfoException(Id)); var campo = await _repository.GetById(Id); return(Ok(campo)); } catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e); return(InternalServerError(e)); } }
public IActionResult Eliminar(RolViewModel rolVM) { RolesRepository rolesRepository = new RolesRepository(); var rolResult = rolesRepository.GetById(rolVM.IdRol); if (rolResult != null) { rolesRepository.Delete(rolResult); } return(RedirectToAction("Rol", "Administrador")); }