1 year ago

#387457

test-img

Leo Barbas

Microsoft.Graph SDK Search members of a group["x"] startwith 'A"

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[$"{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

c#

.net

microsoft-graph-sdks

0 Answers

Your Answer

Accepted video resources