Search code examples
c#microsoft-graph-apimicrosoft-graph-sdks

How to transform Microsoft Graph API query with expand=extensions to SDK code


I am transforming from Graph API to Graph SDK. How can I transform this API call?

https://graph.microsoft.com/v1.0/users/XXX/calendarView?startDateTime=YYY&endDateTime=ZZZ&$expand=extensions($filter=id eq 'NAME')

Expand part is missing. How should I add Expand = ??? or do it somehow with Filter or Select?

var ret = await graphClient.Users[XXX].CalendarView.GetAsync((requestConfiguration) =>
            {
                requestConfiguration.QueryParameters.StartDateTime = YYY;
                requestConfiguration.QueryParameters.EndDateTime = ZZZ;
            });

Thank you for help.


Solution

  • Thank you @user2250152. I made a typo. Solution is as follows:

    requestConfiguration.QueryParameters.Expand = new string[] 
    { 
        "extensions($filter=id+eq+'NAME')" 
    };