Is one of these VB.NET LINQ to SQL Left Join options superior to other?
I’m not sure which to use.
Method 1: Lambda
Dim query = From A In DB.Product_Categories
From B In DB.MasItems.Where(Function(x) CBool(x.itemkey = A.ItemKey)).DefaultIfEmpty
Select A.Name
Method 2: Group Join
Dim query = From A In DB.Product_Categories
Group Join B In DB.MasItems On B.itemkey Equals A.ItemKey Into X = Group
From Y In X.DefaultIfEmpty
Select A.Name()
The generated SQL is the same for both queries, so in LINQ to SQL it is really personal preference.