Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support combining nested LINQ Expand and Select #2439

Open
duckblaster opened this issue Apr 16, 2024 · 2 comments
Open

Support combining nested LINQ Expand and Select #2439

duckblaster opened this issue Apr 16, 2024 · 2 comments
Labels
type:feature New experience request

Comments

@duckblaster
Copy link

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)

@duckblaster duckblaster added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request labels Apr 16, 2024
@MartinM85
Copy link
Contributor

You can use Select and Expand which accept string

graphServiceClient
  .Me
  .Request()
  .Select("id,mail,department,displayName")
  .Expand("memberOf($select=id,displayName)")

@duckblaster
Copy link
Author

Yes, I used that as a workaround, I just thought it would be great to have the option

@andrueastman andrueastman removed the status:waiting-for-triage An issue that is yet to be reviewed or assigned label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New experience request
Projects
None yet
Development

No branches or pull requests

3 participants