![](/img/trans.png)
[英]Microsoft Graph API: $filter & $search not working together
[英]Microsoft Graph API user search with Select & Filter condition doesn't search users with given condition
我正在使用以下代碼來獲取具有匹配顯示名稱的用戶:
var users1 = await graphServiceClient.Users.Request().Select(e => new {
e.DisplayName,
e.GivenName,
e.PostalCode
}).Filter($"DisplayName contains 'Robert'")
.GetAsync();
但是,它沒有顯示任何結果。 我也在嘗試使用通配符或開始搜索,即 Filter(startswith('Robert')) 但這也不起作用。
請幫忙。
您可以嘗試以下方式
var users1 = await graphServiceClient.Users
.Request()
.Filter("startswith(displayName,'Robert')")
.Select( e => new {
e.DisplayName,
e.GivenName
})
.GetAsync();
詳情請參閱官方文檔。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.