简体   繁体   English

MS Graph API V1.0 中的字符串“包含”是否有任何过滤条件

[英]Is there any Filter condition for string "contains" in MS Graph API V1.0

I am using below code to find users in Department :我正在使用以下代码查找部门中的用户:

string searhString="IT Admin Onsite";

var departmentPeoples = await graphServiceClient.Users.Request().Filter($"department eq '{searchString}'").Select(u => new {
                        u.DisplayName,
                        u.MobilePhone,
                        u.BusinessPhones,
                        u.UserPrincipalName
                    }).GetAsync();

But, i want to search all Department which contains ,hence my searchString will be但是,我想搜索包含的所有部门,因此我的 searchString 将是

string searhString="Admin";字符串 searhString="管理员";

I have tries startswith ,but that will work only when my searchString is "IT" in the given example code.我尝试过 startswith ,但只有在给定的示例代码中我的 searchString 为“IT”时,这才有效。 How to achieve this Task?如何实现这个任务?

Please Help.请帮忙。

I'm afraid that contains is not supported on any Microsoft Graph resources.恐怕任何 Microsoft Graph 资源都不支持contains

See details here . 在此处查看详细信息。

Note: The following $filter operators are not supported for Azure AD resources: ne, gt, ge, lt, le, and not.注意:Azure AD 资源不支持以下 $filter 运算符:ne、gt、ge、lt、le 和 not。 The contains string operator is currently not supported on any Microsoft Graph resources.目前,任何 Microsoft Graph 资源都不支持 contains 字符串运算符。

Currently you could get all the results and filter with the Department in your C# code.目前,您可以在 C# 代码中获取所有结果并使用部门进行过滤。

I believe @Allen Wu's answer to this may be outdated.我相信@Allen Wu 对此的回答可能已经过时。 According to this documentation contains appears to be generally supported, but it varies from endpoint to endpoint.根据本文档,包含似乎得到普遍支持,但它因端点而异。 https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MS Graph API v1.0 中查找用户的变量插值问题 - Variable interpolation issue in finding users in MS Graph API v1.0 MS Graph v1.0 个人资料图片资源未找到 - MS Graph v1.0 Profile Picture Ressource Not Found 使用 Microsoft Graph API V1.0 时匹配部门名称的问题 - Issue in Matching Department Name while using Microsoft Graph API V1.0 如何在Microsoft Graph API V1.0 中查找部门中的所有用户 - How to find all users in a department in Microsoft Graph API V1.0 将用户结果从 Microsoft Graph API V1.0 转换为 Json 的问题 - Issue in Converting the Users Results from Microsoft Graph API V1.0 to Json 无法使用通配符搜索模式搜索 Microsoft Graph Api V1.0 用户 - Unable to search Microsoft Graph Api V1.0 users using Wildcard search pattern Microsoft Graph REST API v1.0 获取列表项(10.000.000 列表项来自 SharePoint 列表) - Microsoft Graph REST API v1.0 Get listItem(10.000.000 List Item from a SharePoint list) 尝试使用Microsoft Graph API v1.0查询用户的office365个人资料照片时获取“ErrorAccessDenied” - Getting “ErrorAccessDenied” while trying to query for a user's office365 profile photo using Microsoft Graph API v1.0 MsalServiceException:AADSTS500011:未找到名为 https://graph.microsoft.com/v1.0 的资源主体 - MsalServiceException: AADSTS500011: The resource principal named https://graph.microsoft.com/v1.0 not found 使用 Microsoft Graph v1.0 SDK 创建 OnlineMeeting 时出现 Forbidden 403 错误 - Getting Forbidden 403 error while creating OnlineMeeting using Microsoft Graph v1.0 SDK
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM