Beispiel #1
0
        public override async Task <CitiesPaginationReply> GetCitiesPagination(CitiesPaginationRequest request, ServerCallContext context)
        {
            var getCitiesInfoPagination = await _cityManager.GetCitiesInfoPagination(request.NumberOfCities, request.PageNumber);

            var citiesPaginationReply = _mapper.Map <CitiesPaginationReply>(getCitiesInfoPagination);

            citiesPaginationReply.Cities.AddRange(_mapper.Map <RepeatedField <CityReply> >(getCitiesInfoPagination.CityInfos.ToList()));

            return(citiesPaginationReply);
        }
Beispiel #2
0
        public async Task <CitiesPaginationReply> GetCitiesPagination(int pageNumber = 1, int numberOfCities = 25)
        {
            var request = new CitiesPaginationRequest()
            {
                PageNumber     = pageNumber,
                NumberOfCities = numberOfCities
            };

            var response = await _client.GetCitiesPaginationAsync(request);

            return(response);
        }