如何在Outlook中找到所有具有Prolaw原子的触点

发布于 2025-01-31 06:51:21 字数 418 浏览 4 评论 0 原文

我正在使用以下API获取停止服务后从APP数据库中删除的联系人。

graphClient.User[emailId]
           .Contacts
           .Request()
           .Filter($"singleValueExtendedProperties/Any(ep: ep/id eq '{GlobalConstants.PrimaryKeyMapiId}')")
           .Expand($"singleValueExtendedProperties($filter=id eq '{GlobalConstants.PrimaryKeyMapiId}')"  )
           .GetAsync()
           .Result;

它的抛出例外,请提高解决方案的解决方案

I am using below API to get the contact which was deleted from App Database after stopping Service.

graphClient.User[emailId]
           .Contacts
           .Request()
           .Filter(
quot;singleValueExtendedProperties/Any(ep: ep/id eq '{GlobalConstants.PrimaryKeyMapiId}')")
           .Expand(
quot;singleValueExtendedProperties($filter=id eq '{GlobalConstants.PrimaryKeyMapiId}')"  )
           .GetAsync()
           .Result;

Its throwing exception , Please sugest what will be the solution for this

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

毅然前行 2025-02-07 06:51:21
string a = "String {66f5a359-4659-4830-9070-00040ec6ac6e} Name Fun";
            var res = await graphClient.Users["tinywang@tenant_name.onmicrosoft.com"]
                                .Contacts
                                .Request()
                                .Filter($"singleValueExtendedProperties/Any(ep: ep/id eq '{a}' and ep/value eq 'Food')").GetAsync();

根据我的搜索,当我们要在 singlevalueexteddendedproperties 上添加过滤器时,我们可以关注此文档

然后按我的测试进行,如果我发送了一个请求,例如 https://graph.microsoft.com/v1.0/users/user_id/contacts?use-filter=singlevalueextendedProperties/any(EP :ep/id eq'string {66f5a359-4659-4659-4830-9070-0004040ec6e} name fun'

) “ rel =“ nofollow noreferrer”> “在此处输入图像说明”

因此我们必须像这样称呼API:<< code>https://graph.microsoft.com/v1.0/users/user_id/contacts?$filter=singleValueExtendedProperties/Any(ep: ep/id eq 'String {66f5a359-4659-4830-9070-00040ec6ac6e} Name Fun '和ep/value eq'food')

string a = "String {66f5a359-4659-4830-9070-00040ec6ac6e} Name Fun";
            var res = await graphClient.Users["tinywang@tenant_name.onmicrosoft.com"]
                                .Contacts
                                .Request()
                                .Filter(
quot;singleValueExtendedProperties/Any(ep: ep/id eq '{a}' and ep/value eq 'Food')").GetAsync();

enter image description here

Per my searching, when we want to add a filter on singleValueExtendedProperties, then we can follow this document.

enter image description here

Then per my test, if I sent a request like https://graph.microsoft.com/v1.0/users/user_id/contacts?$filter=singleValueExtendedProperties/Any(ep: ep/id eq 'String {66f5a359-4659-4830-9070-00040ec6ac6e} Name Fun') it will had issue like below

enter image description here

So we have to call api like this: https://graph.microsoft.com/v1.0/users/user_id/contacts?$filter=singleValueExtendedProperties/Any(ep: ep/id eq 'String {66f5a359-4659-4830-9070-00040ec6ac6e} Name Fun' and ep/value eq 'Food')

enter image description here

猫瑾少女 2025-02-07 06:51:21

如例外所述,

The filter expression for $filter does not match to a single extended property
and a value restriction.

您需要添加 value 限制到过滤。

graphClient.User[emailId]
       .Contacts
       .Request()
       .Filter($"singleValueExtendedProperties/Any(ep: ep/id eq '{GlobalConstants.PrimaryKeyMapiId}' and ep/value eq 'Food')")
       .Expand($"singleValueExtendedProperties($filter=id eq '{GlobalConstants.PrimaryKeyMapiId}')"  )
       .GetAsync()
       .Result;

或者,您可以尝试省略 .filter()方法,因为过滤器本身是在 .expand()方法中指定的

graphClient.User[emailId]
           .Contacts
           .Request()
           .Expand($"singleValueExtendedProperties($filter=id eq '{GlobalConstants.PrimaryKeyMapiId}')"  )
           .GetAsync()
           .Result;

As mentioned in the exception

The filter expression for $filter does not match to a single extended property
and a value restriction.

You need to add value restriction to filter.

graphClient.User[emailId]
       .Contacts
       .Request()
       .Filter(
quot;singleValueExtendedProperties/Any(ep: ep/id eq '{GlobalConstants.PrimaryKeyMapiId}' and ep/value eq 'Food')")
       .Expand(
quot;singleValueExtendedProperties($filter=id eq '{GlobalConstants.PrimaryKeyMapiId}')"  )
       .GetAsync()
       .Result;

Or you can try to omit .Filter() method because the filter itself is specified in .Expand() method

graphClient.User[emailId]
           .Contacts
           .Request()
           .Expand(
quot;singleValueExtendedProperties($filter=id eq '{GlobalConstants.PrimaryKeyMapiId}')"  )
           .GetAsync()
           .Result;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文