Given this Data Model, where there are 3 joins between Tag and DisciplineType :
When I execute this Linq query:
I expect the generated SQL to be this:
However, this is the actual SQL generated:
This results in the Where clause in the subquery to try and filter the subresults using a table in the outer query.
This always happens whenever I need to use ThenFetch to eager load something that requires two or more joins.
This is causing the query to execute extremely slowly.
MS SQL Server 2012