ConvertedPagedResult<TSource, T>
A class in Alta.Api.Client, Alta.Api.Client.LowLevel.
Wraps a paged API result and converts each item with a function, so a page of one model type can be read as another.
Constructors
Fields
2 private and internal fields
| Member | What it is |
|---|
private readonly Func<TSource, T> p | The conversion function. |
private readonly IPagedResult<TSource> pagedResult | The wrapped paged result. |
Properties
| Member | What it is |
|---|
bool HasNext { get; } | Whether the wrapped result has another page. |
IEnumerable<T> Results { get; } | The current page's items, converted lazily each time it's read. |
Methods
| Member | What it is |
|---|
async Task<IEnumerable<T>> GetAllAsync() | Fetches every remaining page from the wrapped result and returns the converted items. |
async Task<IEnumerable<T>> GetNextAsync() | Fetches the next page and returns its items converted. |