Ejemplo n.º 1
0
        public async Task <PagedResultDto <CountryListDto> > GetCountryPagedList(GetCountriesInput input)
        {
            var query        = _countryRepository.GetAll();
            var countryCount = await query.CountAsync();

            var countries = await query
                            .OrderBy(input.Sorting)
                            .PageBy(input)
                            .ToListAsync();

            var countryListDtos = countries.MapTo <List <CountryListDto> >();

            return(new PagedResultDto <CountryListDto>(countryCount, countryListDtos));
        }
Ejemplo n.º 2
0
        public async Task <ListResultDto <CountryListDto> > GetCountries(GetCountriesInput input)
        {
            var countries = await _countryRepository.GetAll().ToListAsync();

            return(new ListResultDto <CountryListDto>(countries.MapTo <List <CountryListDto> >()));
        }