Skip to main content

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​

MemberWhat it is
ConvertedPagedResult(IPagedResult<TSource> pagedResult, Func<TSource, T> p)Creates a ConvertedPagedResult from pagedResult and p.

Fields​

2 private and internal fields
MemberWhat it is
private readonly Func<TSource, T> pThe conversion function.
private readonly IPagedResult<TSource> pagedResultThe wrapped paged result.

Properties​

MemberWhat 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​

MemberWhat 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.