Fauna v10 .NET/C# Driver 1.0.0
 
Loading...
Searching...
No Matches
PaginationExtensions.cs
Go to the documentation of this file.
1using Fauna.Types;
2
4
8public static class PaginationExtensions
9{
16 public static async IAsyncEnumerable<T> FlattenAsync<T>(this IAsyncEnumerable<Page<T>> pages)
17 {
18 await foreach (var page in pages)
19 {
20 foreach (var item in page.Data)
21 {
22 yield return item;
23 }
24 }
25 }
26}
record Page< T >(IReadOnlyList< T > Data, string? After)
Represents a page in a dataset for pagination.