-
Notifications
You must be signed in to change notification settings - Fork 854
Open
Labels
AI-thinks-issue-fixedArea-QuotationsQuotations (compiler support or library). See also "queries"Quotations (compiler support or library). See also "queries"BugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
Please provide a succinct description of the issue.
Consider
let src = [0..10].Select(fun n -> {| n = n |}).ToList().AsQueryable()
let q1 = src.Select(fun c -> {| z = c.n; b = c.n |})
printfn "%A" q1.Expression
let q2 = src.Select(fun c -> {| b = c.n; z = c.n |})
printfn "%A" q2.Expression
Provide the steps required to reproduce the problem:
- Run the program
Expected behavior
Both Expression trees passed to Select should call a two argument constructor for the anonymous type directly.
Actual behavior
The first call to Select creates a nested lambda function call using Invoke 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.
- Windows 10
- .NET Core 5
- LINQPad
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
AI-thinks-issue-fixedArea-QuotationsQuotations (compiler support or library). See also "queries"Quotations (compiler support or library). See also "queries"BugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Type
Projects
Status
New