Based on another post, I can filter via HTTP requests as follows:
https://graph.microsoft.com/v1.0/me/events?
$filter=categories/any(a:a+eq+'Red+Category')
I am not sure what the a:a stands for here but it works.
I want to replicate this in Microsoft Graph SDK, I am using a query option as per below which does not return any results:
List<QueryOption> options = new List<QueryOption>
{
new QueryOption("$filter",
"categories/any(a:a+eq+'Red+Category'")
};
You seem to be executing a search instead of a filter in your c# code.
Try using:
var request = graphClient.Users[userId].Events.Request().Filter("categories/any(a:a+eq+'Red+Category')");
var result = await request.GetAsync();
Or alternatively:
List<QueryOption> options = new List<QueryOption>
{
new QueryOption("$filter",
"categories/any(a:a+eq+'Red+Category')")
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With