Table of Contents

Class Pager<T>

Namespace
OpenShell
Assembly
OpenShell.Sdk.dll

A lazily evaluated listing. Enumerate it for items, or call PagesAsync(CancellationToken) for pages.

public sealed class Pager<T> : IAsyncEnumerable<T>

Type Parameters

T
Inheritance
Pager<T>
Implements
Inherited Members

Methods

GetAsyncEnumerator(CancellationToken)

Returns an enumerator that iterates asynchronously through the collection.

public IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A CancellationToken that may be used to cancel the asynchronous iteration.

Returns

IAsyncEnumerator<T>

An enumerator that can be used to iterate asynchronously through the collection.

PagesAsync(CancellationToken)

Enumerates page by page.

public IAsyncEnumerable<Page<T>> PagesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

IAsyncEnumerable<Page<T>>

ToListAsync(CancellationToken)

Collects every item into a list.

public ValueTask<List<T>> ToListAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask<List<T>>