<PackageReference Include="Refit" Version="17.0.0" />

Refit.PagedEnumerable<TPage, TItem>

public sealed class PagedEnumerable<TPage, TItem> : IAsyncEnumerable<TItem>
A lazily fetched sequence of pages, enumerable as items or as the API's own page objects. Every enumeration starts again from the first page and invokes the page-fetching call once per page; nothing is requested until it is enumerated.
public IAsyncEnumerable<TPage> AsPages()

Gets the pages as the API returned them, each disposed when the consumer moves past it.

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

public IObservable<TItem> ToObservable()

Gets the items as an observable that enumerates from the first page on every subscription.

public IObservable<TPage> ToPageObservable()

Gets the pages as an observable that enumerates from the first page on every subscription.

public PagedEnumerable<TPage, TItem> WithMaxPages(int pages)

Returns a sequence that fetches at most pages pages, however many the API has.

public PagedEnumerable<TPage, TItem> WithPrefetch()

Returns a sequence that requests the next page while the consumer is still working through the current one.