IGraphServiceUsersCollectionRequest (GraphServiceClient) 的部门非空过滤器
如何为部门属性创建非空过滤器以通过GraphServiceClient获取用户?
department ne null
并且
NOT(department eq null)
不起作用
我当前的代码:
var request = _graphClient.Users.Request()
.Filter($"department ne null");
var usersPage = await request.GetAsync();
How to create not null filter for department property to get users by GraphServiceClient?
department ne null
and
NOT(department eq null)
don't work
My current code:
var request = _graphClient.Users.Request()
.Filter(quot;department ne null");
var usersPage = await request.GetAsync();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
按
department
过滤需要添加标头ConsistencyLevel:eventual
,并且$count
参数必须设置为true
。根据文档
department
仅在$select
上返回。这意味着,如果您需要知道department
的值,则必须添加Select
方法并指定要返回的所有属性,包括department
。资源:
高级查询
用户属性
Filtering by
department
requires adding headerConsistencyLevel:eventual
and$count
parameter must be set totrue
.According to the documentation
department
is returned only on$select
. It means that if you need to know the value ofdepartment
you have to addSelect
method and specify all properties to be returned includingdepartment
.Resources:
Advanced queries
User properties