使用搜索 Microsoft Graph API C# [英] Use search Microsoft Graph API C#

查看:39
本文介绍了使用搜索 Microsoft Graph API C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 C# 中的 Graph API 过滤 ToReceipient.

根据

解决方案

您可以尝试使用 QueryOptions 类,如下所示.

Listoptions = new List{new QueryOption("$search", "lunch")};var messages = await client.Users[user@domain.com"].Messages.Request(options).GetAsync();

您还可以使用过滤器、顶部和其他查询参数.

I am trying to filter the ToReceipient using Graph API in C#.

as per Unable to filter messages by recipient in Microsoft Graph Api. One or more invalid nodes

at the moment Filter does not support ToRecipient. I need to use Search.

However in c# as per screenshot and code below, it does not seem to have search property, only filter. Anyone knows how to use Search in Graph API c#? I also need to filter it based on multiple toRecipient Email addresses. Thanks.

IUserMessagesCollectionPage msgs = await client.Users["user@domain.com"].Messages.Request().Filter ==> exist

IUserMessagesCollectionPage msgs = await client.Users["user@domain.com"].Messages.Request().Search ==> does not exist

解决方案

You can try using QueryOptions class as below.

List<QueryOption> options = new List<QueryOption> 
{            
    new QueryOption("$search", "lunch") 
}; 

var messages = await client.Users["user@domain.com"].Messages.Request(options).GetAsync();

You can also use filter, top and other query parameters as well.

这篇关于使用搜索 Microsoft Graph API C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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