Microsoft.graph SDK搜索成员组的组[X&quot] startwith; a; a;
我想将此 OData 转换复制到我的 DOTNET 核心项目中:
我正在使用 Microsoft.Graph (4.2.0) nuget 包
这是我的 OData 转换,可以在 Graph Explorer 中正常工作。 (https://developer.microsoft.com/en-us/graph/graph -资源管理器)
https://graph.microsoft.com/v1.0/groups/02bd9fd6-8f93-4758-87c3-1fb73740a315/members?$count=true&$filter=startswith(displayName, 'A')
这是我的代码:
var queryOptions = new List<QueryOption>();
queryOptions.Add(new QueryOption("$count", "true"));
var groupMembers = await graphClient.Groups[$"{groupId}"].Members
.Request(queryOptions)
.Header("ConsistencyLevel", "eventual")
//.Filter("startswith(displayName, 'E')")
//.Search("displayName:Eric")
.GetAsync();
当我尝试运行:
.Filter("startswith(displayName, 'E')")
我收到错误:
代码:Request_UnsupportedQuery 消息:当前不支持引用属性查询的指定过滤器
我无法使用 .Search,因为 “IGroupMembersCollectionWithReferencesRequest”不包含搜索定义
I would like to replicate this OData cast into my DOTNET core project:
I am using Microsoft.Graph (4.2.0) nuget package
This is my OData cast that works fine in Graph Explorer. (https://developer.microsoft.com/en-us/graph/graph-explorer)
https://graph.microsoft.com/v1.0/groups/02bd9fd6-8f93-4758-87c3-1fb73740a315/members?$count=true&$filter=startswith(displayName, 'A')
This is my code:
var queryOptions = new List<QueryOption>();
queryOptions.Add(new QueryOption("$count", "true"));
var groupMembers = await graphClient.Groups[quot;{groupId}"].Members
.Request(queryOptions)
.Header("ConsistencyLevel", "eventual")
//.Filter("startswith(displayName, 'E')")
//.Search("displayName:Eric")
.GetAsync();
When I try to run with:
.Filter("startswith(displayName, 'E')")
I receive the error:
Code: Request_UnsupportedQuery Message: The specified filter to the reference property query is currently not supported
I cannot use .Search because
'IGroupMembersCollectionWithReferencesRequest' does not contain a definiton for Search
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下代码对我有用:
The following code worked for me: