Expression tree with anonymous type created incorrectly #11127
Labels
Area-Quotations
Quotations (compiler support or library). See also "queries"
Bug
Impact-Low
(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Please provide a succinct description of the issue.
Consider
Provide the steps required to reproduce the problem:
Expected behavior
Both
Expression
trees passed toSelect
should call a two argument constructor for the anonymous type directly.Actual behavior
The first call to
Select
creates a nested lambda function call usingInvoke
instead of just passing the arguments to the constructor.Known workarounds
Putting the fields in the anonymous record in alphabetical order will correct the error.
Related information
This makes EF Core difficult to use with anonymous records.
The text was updated successfully, but these errors were encountered: