Assume we have an inheritance hierarchy with base class Customer and derived class CustomerDerived. Customer has a One-to-One association with Address.The following code results in multiple LEFT JOIN statements being generated in the SQL sent to the database server. The number of LEFT JOINS equals the number of classes in the inheritance hierarchy. DataLoadOptions dlo = new DataLoadOptions(); dlo.LoadWith<Customer>(c => c.Addresses); db.LoadOptions = dlo; var q = from c in db.Customers select c;Below is the resulting SQL generated by Linq to Sql:SELECT [t0].[CustomerTypeId], [t0].[CustomerId], [t0].[Name], [t2].[test], [t2].[AddressId], [t2].[CustomerId] AS [CustomerId2], [t2].[Street], [t4].[test] AS [test2], [t4].[AddressId] AS [AddressId2], [t4].[CustomerId] AS [CustomerId3], [t4].[Street] AS [Street2]FROM [dbo].[Customer] AS [t0]LEFT OUTER JOIN ( SELECT 1 AS [test], [t1].[AddressId], [t1].[CustomerId], [t1].[Street] FROM [dbo].[Address] AS [t1] ) AS [t2] ON [t2].[CustomerId] = [t0].[CustomerId]LEFT OUTER JOIN ( SELECT 1 AS [test], [t3].[AddressId], [t3].[CustomerId], [t3].[Street] FROM [dbo].[Address] AS [t3] ) AS [t4] ON [t4].[CustomerId] = [t0].[CustomerId]Note the two JOINS and that "1 AS test" appearing in the projection? Now consider a real-life scenario where we have 5 classes in the hierarchy and 5 associated tables. This results in 25 JOINs and a huge projection.
Version