public async Task <bool> MoveNextAsync(CancellationToken cancellationToken) { if (_currentPageEnumerator.MoveNext()) { return(true); } if (string.IsNullOrEmpty(_currentPage.NextPageLink)) { return(false); } _currentPageEnumerator.Dispose(); _currentPage = await _currentPage.GetPageAsync(_currentPage.NextPageLink, cancellationToken); _currentPageEnumerator = _currentPage.GetEnumerator(); return(_currentPageEnumerator.MoveNext()); }
public Enumerator(PagedResponse <T> that) { _currentPage = that; _currentPageEnumerator = _currentPage.GetEnumerator(); }