Reputation: 225
Using Microsoft Graph client sdk how would one go about using search Odata query to lookup if subject or body contains a certain search term.
The $search Odata query parameter is available in the Graph Client api, but i could not find how to use the parameter using the client sdk for c#.
Upvotes: 9
Views: 6985
Reputation: 670
Piggybacking off of @JohnStaurt's comments above, this worked for me:
List<QueryOption> options = new List<QueryOption>
{
new QueryOption("$search", "\"displayName:team\" OR \"description:team\"")
};
Upvotes: 2
Reputation: 2447
You can add any query parameters by passing in a list of QueryOptions
to the Request
method.
List<QueryOption> options = new List<QueryOption>
{
new QueryOption("$search", "lunch")
};
var messages = await client.Me.Messages.Request(options).GetAsync();
Documentation: https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/overview.md#custom-query-options
Upvotes: 19