I wanted to use the PageIterator in my project, and it works perfectly until I wanted to take out group members from AzureAD. No matter what I do, the PageIterator failes with 'The Parsable does not contain a collection property'.
List<User> users = new();
var result = await graphClient.Groups[groupId].Members.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Top = 2;
// I only do this to force pageing, will not be on final version
});
var pageIterator = PageIterator<User, DirectoryObjectCollectionResponse>
.CreatePageIterator(graphClient, result,
(m) =>
{
users.Add(m);
return true;
});
await pageIterator.IterateAsync();
My code forces 2 items. It's only because I, in a desperate attempt, tries to figure out what is wrong with my code.
I am left clueless on what's wrong here and any help would be awesome.