You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DECLARE @__p_0 int=3;
SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[OneId], [t].[TwoId], [t0].[OneId], [t0].[TwoId], [t0].[Id], [t0].[Name]
FROM [EntityOnes] AS [e]
INNER JOIN (
SELECT [e0].[Id], [e0].[CollectionInverseId], [e0].[Name], [e0].[ReferenceInverseId], [j].[OneId], [j].[TwoId]
FROM [JoinOneToTwo] AS [j]
INNER JOIN [EntityTwos] AS [e0] ON [j].[TwoId] = [e0].[Id]
) AS [t] ON [e].[Id] = [t].[OneId]
LEFT JOIN (
SELECT [j0].[OneId], [j0].[TwoId], [e1].[Id], [e1].[Name]
FROM [JoinOneToTwo] AS [j0]
INNER JOIN [EntityOnes] AS [e1] ON [j0].[OneId] = [e1].[Id]
WHERE [e1].[Id] = @__p_0
) AS [t0] ON [t].[Id] = [t0].[TwoId]
WHERE [e].[Id] = @__p_0
ORDER BY [e].[Id], [t].[OneId], [t].[TwoId], [t].[Id], [t0].[OneId], [t0].[TwoId], [t0].[Id]
The text was updated successfully, but these errors were encountered:
Include will bring join entity. EntityOne should not materialize again if already tracked by context. And client side SelectMany will correct the returning shape.
We made a patch fix to the query in #23589. This issue is now in 6.0 to add a cleaner, non-patch solution.
Original issue
The query must:
This is what we currently generate:
Which translates to the following on SQL Server:
The text was updated successfully, but these errors were encountered: