-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Copy link
Labels
area-querycustomer-reportedpreview-7priority-bugIssues which requires API breaks and have bigger impact hence should be fixed earlier in the releaseIssues which requires API breaks and have bigger impact hence should be fixed earlier in the release
Milestone
Description
myDbSet.Where(m => m.Id == 2)
.SelectMany(m => m.CourrielsMembres.DefaultIfEmpty().Select(cm => new { Id = m.Id, subId = cm.Id }))
.ToList();
Produce {"Id":0,"subId":0} instead of {"Id":2,"subId":0}
Here is the SQL generated:
SELECT [t].[Id], [t].[Id0] AS [subId]
FROM [Membre] AS [m]
OUTER APPLY (
SELECT [m].[Id], [c].[Id] AS [Id0], [c].[MembreId]
FROM [CourrielMembre] AS [c]
WHERE [m].[Id] = [c].[MembreId]
) AS [t]
WHERE [m].[Id] = 2
It should take [m].[Id] instead of [t].[Id] at the beginning of the select clause.
EF Core version: EF core 3.1 preview 3
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 3.0
Operating system: Windows 7
IDE:Visual Studio 2019 16.3.10
ArneMancofi
Metadata
Metadata
Assignees
Labels
area-querycustomer-reportedpreview-7priority-bugIssues which requires API breaks and have bigger impact hence should be fixed earlier in the releaseIssues which requires API breaks and have bigger impact hence should be fixed earlier in the release