I have Tasks table with two navigation properties - VersionReported and VersionResolved, both stored in table Versions. When I try to get Task list with included both properties, I get too many joins in SQL (this is only part of sql from profiler):
LEFT OUTER JOIN [dbo].[Versions] AS [Extent4] ON [Extent1].[IDVersionReported] = [Extent4].[ID]
LEFT OUTER JOIN [dbo].[Versions] AS [Extent5] ON [Extent1].[IDVersionReported] = [Extent5].[ID]
LEFT OUTER JOIN [dbo].[Versions] AS [Extent6] ON [Extent1].[IDVersionReported] = [Extent6].[ID]
LEFT OUTER JOIN [dbo].[Versions] AS [Extent7] ON [Extent1].[IDVersionReported] = [Extent7].[ID]
LEFT OUTER JOIN [dbo].[Versions] AS [Extent8] ON [Extent1].[IDVersionResolved] = [Extent8].[ID]
LEFT OUTER JOIN [dbo].[Versions] AS [Extent9] ON [Extent1].[IDVersionResolved] = [Extent9].[ID]
LEFT OUTER JOIN [dbo].[Versions] AS [Extent10] ON [Extent1].[IDVersionResolved] = [Extent10].[ID]
LEFT OUTER JOIN [dbo].[Versions] AS [Extent11] ON [Extent1].[IDVersionResolved] = [Extent11].[ID]
Extent1 is Tasks table. I know that EntityFramework has problem when two or more navigation properties lead to the same table, but did anyone find a solution?