Issue using Graph Filter with the 5.3 SDK.

John Pike 25 Reputation points
2023-03-27T20:26:55.5266667+00:00

I have recently upgraded my SDK to version 5.3. When I did that, it chanaged the acceptable methods and properties that used to work in the previous version. My question is how do I get subsequent pages of results once I issue the initial query. This is the new query:

var results = await eventServiceClient.Users[users.Value[i].Id].Calendar.Events.GetAsync((requestConfiguration) =>
{ 
     requestConfiguration.QueryParameters.Top = 999;
     requestConfiguration.QueryParameters.Select = new string[] { "Start", "End", "Body", "BodyPreview", "Subject", "CreatedDateTime", "LastModifiedDateTime", "Type" };
     requestConfiguration.QueryParameters.Filter = "start/dateTime ge '2023-03-27'";
     requestConfiguration.QueryParameters.Orderby = new string[] { "start/dateTime" };
});

This is the way that I used to get the next page of results.

do
{
     ecount += results.Count;
     events.AddRange(results.ToList());
     if (results.Value != null)
     {
           // This gets the subsequent pages.
           results = await results.NextPageRequest.GetAsync();
           if (results.NextPageRequest == null)
           {
                 ecount += results.CurrentPage.Count;
                 events.AddRange(results.ToList());
           }
     }
     else
     {
           isnext = false;
     }
} while ((results.NextPageRequest != null) && (isnext == true));
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,485 questions
0 comments No comments
{count} votes