-
Can anyone help in explaining how keyset pagination works for the GET Projects endpoint?
And then I'm going through the enumerator and adding the current project to a list, until the count is higher than the pageSize. How do I go about retrieving the next page? In the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @m-rusu, The call to For instance, say you wanted to get the first 83 projects. The optimal way would probably be to
var perPage = 83;
var query = new ProjectQuery()
{
OrderBy = "id",
PerPage = perPage,
Ascending = true
};
foreach (var project in client.Projects.GetAsync(query).Take(perPage))
{
} Note that the call to |
Beta Was this translation helpful? Give feedback.
-
Alright, thank you for the response! |
Beta Was this translation helpful? Give feedback.
Hi @m-rusu,
The call to
IProjectClient.GetAsync(ProjectQuery query)
returns aGitLabCollectionResponse<Project>
, which can be directly enumerated synchronously or asynchronously. Handling of GitLab pages is done under the hood, so you don't need to worry about accessing successive pages yourself. SpecifyingProjectQuery.PerPage
is not required (it will default to 20), but you may get better results in certain cases if you do.For instance, say you wanted to get the first 83 projects. The optimal way would probably be to