Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible documentation error #701

Open
nester-a opened this issue Dec 18, 2023 · 0 comments
Open

Possible documentation error #701

nester-a opened this issue Dec 18, 2023 · 0 comments

Comments

@nester-a
Copy link

I think I found an error in your documentation in the "data pagination" section.

// users is of type `PaginationResult`
var users = query.Paginate(1, 10);

foreach(var user in users.Each)
{
    Console.WriteLine($"Id: {user.Id}, Name: {user.Name}");
}

In this example, it means that we can iterate over the returned data.

But this example incorrect. In fact users.Each returns PaginationIterator<T> which has this enumerator:

public IEnumerator<PaginationResult<T>> GetEnumerator()
        {
            CurrentPage = FirstPage;
            yield return CurrentPage;
            while (CurrentPage.HasNext)
            {
                CurrentPage = CurrentPage.Next();
                yield return CurrentPage;
            }
        }

Is this a mistake in the documentation, or am I just misunderstanding it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant