-
-
Notifications
You must be signed in to change notification settings - Fork 544
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
[API Proposal]: Support for selecting multiple properties in single expression. #2479
Comments
I assume that should be only possible for Asking, because strictly speaking e.g. What does the rest think? |
Why do you think so? 🤔 AFAIK this is also a way of defining ordering, at least for some frameworks. |
Huh.. that's true |
@IT-VBFK , on the other hand, linq throws because anonymous types do not implement var a = new []
{
new { x = 1, y = -1},
new { x = -1, y = 1}
};
a[0].GetType().Dump();
a.Order().ToList(); |
The question is: What do we want to achieve here? |
Please refrain from creating a PR until we ask for it or we label the issue as |
Ok, I converted it to a draft. But I leave it open. Take it as a sketch 😉 |
Background and motivation
If I write assertion this way:
the exception is thrown:
So I have to write it slightly more verbose.
API Proposal
So, my proposal is to treat expression for anonymous object creation as an enumeration of properties to exclude.
For example EF Core uses this approach for defining composite key.
API Usage
Alternative Designs
No response
Risks
No response
Are you willing to help with a proof-of-concept (as PR in that or a separate repo) first and as pull-request later on?
No
The text was updated successfully, but these errors were encountered: