EF 4.0+ LEFT JOIN :
var query = from c1 in db.Category
join c2 in db.Category on c1.CategoryID equals c2.ParentCategoryID
into ChildCategory
from cc in ChildCategory.DefaultIfEmpty()
select new CategoryObject
{
CategoryID = c1.CategoryID,
ChildName = cc.CategoryName
}
SQL Server Profiler, , LEFT OUTER JOIN. , LEFT JOIN ( "Group Join" ) Linq-to-Entity, , self-join INNER JOIN - !
Permission for it? Like crazy, and according to MS it sounds wrong, I solved it by changing the order of the connection sentences. If the self-regulatory LEFT JOIN clause was the first Linq Group, SQL Profiler reported an INNER JOIN. If the LEFT JOIN suggestion for self-regulation was LAST Linq Group Join, SQL Profiler reported LEFT JOIN.
source
share