public Result List(AdminRoleFilterDto dto) { var result = new AdminRoleActionFactory(_adminRoleRepository, _unitOfWork).ExecuteAction(dto); if (!result.Success) { return(result); } var query = _adminRoleRepository.AsNoTracking; query = new AdminRoleFilter(query, dto).FilteredQuery(); query = new AdminRoleListOrder(query, dto).OrderByQuery(); result.SetPaging(dto.Page, dto.Size, query.Count()); result.Data = query.Select(s => new { s.Id, s.Name, UsersCount = s.Users.Count }) .ToPaged(result.Paging.Page, result.Paging.Size) .ToList(); return(result); }
public JsonResult Index(AdminRoleFilterDto dto) { return(ToJsonResult(_adminRoleService.List(dto))); }