msgraph-sdk-dotnet
msgraph-sdk-dotnet copied to clipboard
Support combining nested LINQ Expand and Select
Is your feature request related to a problem? Please describe the problem.
I am trying to select only a couple of properties from an expanded collection using LINQ, but .Expand()
doesn't allow using .Select()
on sub properties.
Describe the solution you'd like.
graphServiceClient
.Me
.Request()
.Select(x => new { x.Id, x.Mail, x.DisplayName, x.Department })
.Expand(x => new { MemberOf = x.MemberOf.Select(x => new { x.Id, x.DisplayName }) })
Additional context?
The query that I an trying to generate, that I have verified works in graph explorer: https://graph.microsoft.com/v1.0/me?$select=id,mail,department,displayName&$expand=memberOf($select=id,displayName)