Reputation: 10703
For some reason I am getting a syntax error on the below code. What I am trying to achieve is A LEFT JOIN with MULTIPLE JOIN CLAUSES. The syntax error occurs at the Keyword INTO foobar. VS 2012 says unexpected Token. Any help would be great, thank you !
Dim results = From f In foo _
Join b In bar On new with {f.Type,f.ID} Equals New With {"Test",b.ID} into fooBar _
from x in foobar.DefaultEmpty() _
Where foo.id = 1
Upvotes: 0
Views: 540
Reputation: 152654
You want a Group Join
:
Dim results = From f In foo _
Group Join b In bar On
New With {f.Type,f.ID} Equals New With {"Test",b.ID} _
Into fooBar = Group _
from x in foobar.DefaultEmpty() _
Where foo.id = 1
Upvotes: 1
Reputation: 7092
Try to cast the f.ID
or b.ID
Dim results = From f In foo _
Join b In bar On new with {f.Type, CInt(f.ID)} Equals New With {"Test", CInt(b.ID)} into fooBar _
from x in foobar.DefaultEmpty() _
Where foo.id = 1
Upvotes: 0