Exemplo n.º 1
0
        public virtual async Task <PagedResultDto <ApiResourceDto> > GetAsync(ApiResourceGetByPagedInputDto apiResourceGetByPaged)
        {
            var apiResources = await ApiResourceRepository.GetListAsync(apiResourceGetByPaged.Sorting,
                                                                        apiResourceGetByPaged.SkipCount, apiResourceGetByPaged.MaxResultCount);

            var apiResourceCount = await ApiResourceRepository.GetCountAsync();

            return(new PagedResultDto <ApiResourceDto>(apiResourceCount,
                                                       ObjectMapper.Map <List <ApiResource>, List <ApiResourceDto> >(apiResources)));
        }
        public virtual async Task <PagedResultDto <ApiResourceDto> > GetListAsync(ApiResourceGetByPagedInputDto input)
        {
            var apiResources = await ApiResourceRepository.GetListAsync(input.Sorting,
                                                                        input.SkipCount, input.MaxResultCount,
                                                                        input.Filter);

            // 未加Filter过滤器? 结果数不准
            var apiResourceCount = await ApiResourceRepository.GetCountAsync();

            return(new PagedResultDto <ApiResourceDto>(apiResourceCount,
                                                       ObjectMapper.Map <List <ApiResource>, List <ApiResourceDto> >(apiResources)));
        }
 public virtual async Task <PagedResultDto <ApiResourceDto> > GetListAsync(ApiResourceGetByPagedInputDto input)
 {
     return(await ApiResourceAppService.GetListAsync(input));
 }