I keep getting the above error when try to sort the list on displayName, however sorting is clearly supported according the example below: https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=csharp#request-3
I tried adding ConsistencyLevel headers and count query param with no luck.
var users = await GraphHelper.client.Users
.Request() //new List<QueryOption>() { new QueryOption("$count","true") }
.Header("ConsistencyLevel", "eventual")
.Filter($"accountEnabled eq true and extension_{AppConfig.variable["B2C:ExtensionId"]}_BankId eq '{bankId}'")
.OrderBy("displayName")
.Select($"id,displayName,identities,extension_{AppConfig.variable["B2C:ExtensionId"]}_BankId").GetAsync();
Same query works in graph explorer but not in the REST API.
https://graph.microsoft.com/v1.0/users?$search="displayName:wa"&$orderby=displayName
works buthttps://graph.microsoft.com/v1.0/users?$filter=accountEnabled%20eq%20true&$orderby=displayName
returnsRequest_UnsupportedQuery
– Chris Gunawardena