Example #1
0
        private bool HandleResults(ResultsPage <TItem> result, CancellationToken cancellationToken)
        {
            if (result.Results == null || !result.Results.Any())
            {
                return(false);
            }

            cancellationToken.ThrowIfCancellationRequested();

            _pageNumber++;

            var recordNumberStart = (_pageNumber - 1) * _pageSize + 1;
            var recordNumberEnd   = recordNumberStart + result.Results.Count - 1;

            result.SetInformationKnownByClient(_pageNumber, recordNumberStart, recordNumberEnd);

            _nextPageTokens = result.GetNextPagingTokens();

            _current = result;

            return(true);
        }