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)); }
public async Task <ListResultDto <CountryListDto> > GetCountries(GetCountriesInput input) { var countries = await _countryRepository.GetAll().ToListAsync(); return(new ListResultDto <CountryListDto>(countries.MapTo <List <CountryListDto> >())); }