I understand that based on the documentation here that with the C# Graph SDK library I can continue requesting the next page of results until NextPageRequest == null, but I was wondering if I could save the NextLink I get back and if I encounter an error, the next time this is executed, I could resume at the place I was at using the NextLink (using the C# SDK library).
I haven't been able to find anything in the documentation around this. Is this perhaps something I could do with the RequestBuilder?
I figured it out, or least a way that works using the skipToken (maybe there is a nicer built in library function way of doing this).
Example query:
var groupMembersPaged = await graphClient.Groups[groupId]
.Members
.Request()
.Top(5)
.GetAsync();
var skipToken = groupMembersPaged.NextPageRequest.QueryOptions
.Where(qo => qo.Name == "$skiptoken")
.FirstOrDefault();
if (skipToken != null)
{
var queryOptions = new List<QueryOption>
{
new QueryOption("$skiptoken", skipToken.Value)
};
var groupMembersPagedSkip = await graphClient.Groups[groupId]
.Members
.Request(queryOptions)
.GetAsync();
}