question

AlmogRubinstein-6078 avatar image
1 Vote"
AlmogRubinstein-6078 asked saldana-msft edited

Converting from API to SDK C# - unable to query microsoft.graph.group

Hello Graph support,
I want to execute the following query:
GET https://graph.microsoft.com/beta/users/{id}/transitiveMemberOf/microsoft.graph.group?$orderby=displayName&$select=displayName

Via SDK but I am unable to address the microsoft.graph.group path,
What I was able to do is:
var userTransitiveMemberOfCollection =
await graphServiceClient.
Users[aadUserId].
TransitiveMemberOf.
Request().
GetAsync();

In the query above I'm unable to select the displayName because the return type is directoryObject and it has only the id property.
I also would like to query in the same way the user's directoryRole names, if possible, query all user's directory role and group names in 1 query.

Is there a way to execute the API request via your C# SDK?

I took this query from the example:
https://docs.microsoft.com/en-us/graph/api/user-list-transitivememberof?view=graph-rest-beta&tabs=http


Thanks,
Almog

microsoft-graph-sdkmicrosoft-graph-usersmicrosoft-graph-identitymicrosoft-graph-groups
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Adding right tags/teams to assist

0 Votes 0 ·

1 Answer

FreddieChristiansen-5102 avatar image
0 Votes"
FreddieChristiansen-5102 answered

Also facing the same issue. Still learning C# and the Microsoft Graph SDK, so any advice on this issue would be highly appreciated.


107016-image.png


107059-image.png





image.png (24.0 KiB)
image.png (74.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.