EF Core 8 & 9 include parameters for "external" primitive variables & collections included in select #35567
Labels
area-query
closed-no-further-action
The issue is closed and no further action is planned.
customer-reported
Bug description
Since version 8 and onward, EF core seems to add parameters for primitive typed and primitive collection typed "external" variables that are included in
Select
s (which is as best as I can describe it 😅; please feel free to reword this issue as necessary).I've included a repro below in which,
In case 1, only
id
is selected, as expected.In cases 2, 3 & 4, extra parameters are present in the query when "external"
int
,List<int>
andList<double>
variables are included in the select.This doesn't seem to be an issue in cases 5 & 6, in which a non-primitive variable (anonymous object) is included in the select.
I'm noticing that,
EF core
7.0.20
selects only theid
column and no parameters, as expected.EF core
8.0.12
&9.0.1
both select theid
column as expected, but also include parameters as described above.Your code
Stack traces
Verbose output
EF Core version
9.0.1
Database provider
Microsoft.EntityFrameworkCore.SqlServer
Target framework
.NET 9.0.102
Operating system
Windows 11
IDE
Microsoft Visual Studio Professional 2022 x64 17.12.4
The text was updated successfully, but these errors were encountered: