Interface IPager<TContent>
Interface for an object that can retrieve pages of content.
Namespace: Tableau.Migration.Paging
Assembly: Tableau.Migration.dll
Syntax
public interface IPager<TContent>
Type Parameters
Name | Description |
---|---|
TContent | The content type. |
Methods
GetAllPagesAsync(Action<int>, Action<IImmutableList<TContent>>, CancellationToken)
Processes all pages of content.
Declaration
Task<IResult> GetAllPagesAsync(Action<int> initCapacity, Action<IImmutableList<TContent>> pageAction, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
Action<int> | initCapacity | An action to take once the first page is loaded and the total needed capacity is known. |
Action<IImmutableList<TContent>> | pageAction | An action to take on each page. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IResult> | The combined results. |
GetAllPagesAsync(CancellationToken)
Combines all pages of content.
Declaration
Task<IResult<IImmutableList<TContent>>> GetAllPagesAsync(CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IResult<IImmutableList<TContent>>> | The combined results. |
NextPageAsync(CancellationToken)
Gets a page of content.
Declaration
Task<IPagedResult<TContent>> NextPageAsync(CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IPagedResult<TContent>> | The paged results. |