Last active
February 8, 2023 20:28
-
-
Save maisarissi/b7f2a5bde58923bad0439a6c770db149 to your computer and use it in GitHub Desktop.
msgraph-dotnet-v5-rc-pagination
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var usersResponse = await graphServiceClient | |
.Users | |
.GetAsync(requestConfiguration => { | |
requestConfiguration.QueryParameters.Select = new string[] {"id", "createdDateTime"}; | |
requestConfiguration.QueryParameters.Top = 1; }); | |
var userList = new List<User>(); | |
var pageIterator = PageIterator<User,UserCollectionResponse> | |
.CreatePageIterator(graphServiceClient,usersResponse, (user) => { | |
userList.Add(user); | |
return true; }); | |
await pageIterator.IterateAsync(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment