コード例 #1
0
        public async Task <PagedResultDto <OrganizationDto> > GetListAsync(GetOrganizationListDto input)
        {
            if (input.Sorting.IsNullOrWhiteSpace())
            {
                input.Sorting = nameof(Organization.Name);
            }

            var organizations = await _orgRepository.GetListAsync(
                input.SkipCount,
                input.MaxResultCount,
                input.Sorting,
                input.Filter
                );

            var totalCount = await AsyncExecuter.CountAsync(
                _orgRepository.WhereIf(
                    !input.Filter.IsNullOrWhiteSpace(),
                    organization => organization.Name.Contains(input.Filter)
                    )
                );

            return(new PagedResultDto <OrganizationDto>(
                       totalCount,
                       ObjectMapper.Map <List <Organization>, List <OrganizationDto> >(organizations)
                       ));
        }
コード例 #2
0
 public Task <PagedResultDto <OrganizationDto> > GetListAsync(GetOrganizationListDto input)
 {
     return(_orgAppSvc.GetListAsync(input));
 }