Skip to content

Possible documentation error #701

Open
@nester-a

Description

@nester-a

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions