使用Microsoft Graph客户端SDK您将如何使用搜索Odata查询 [英] Using Microsoft Graph client sdk how would you use search Odata query

查看:77
本文介绍了使用Microsoft Graph客户端SDK您将如何使用搜索Odata查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Microsoft Graph客户端sdk,如果主题或正文包含某个搜索词,如何使用搜索Odata查询进行查找.

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.

Graph Client api中提供了$ search Odata查询参数,但是我找不到如何使用客户端sdk for c#来使用该参数的方法.

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#.

推荐答案

您可以通过将 QueryOptions 列表传递给 Request 方法来添加任何查询参数./p>

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();

文档: https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/overview.md#custom-query-options

这篇关于使用Microsoft Graph客户端SDK您将如何使用搜索Odata查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆