microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

Expression syntax for Select is missing in v5

Open
#2,248 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2 Request: feature
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug
When using v4 you can choose which fields to include using an Expression<...>. I cannot find the equivalent in v5, the migration guide only mentions using an array of strings.

To Reproduce
Steps to reproduce the behavior:

  1. Use v4 of the library
  2. Have code like var o365users = await client.Users.Request().Select(u => new { u.UserPrincipalName, u.Mail }).GetAsync();
  3. Upgrade to v5 of the library
  4. Have code like var o365users = await client.Users.GetAsync(requestConfiguration => { requestConfiguration.QueryParameters.Select = new[] { "???", "???" }; });

Expected behavior
The ability to use expression syntax without having to resort to undiscoverable strings that require knowing how the underlying API works.

Related issues
https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/166

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the v5 query-parameter options section in docs/upgrade-to-v5.md and review related issue #166. Compare the v4 expression-based Select example with the v5 request configuration shown here. Done means v5 offers a discoverable expression-based way to select fields without requiring undocumented API field strings.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.