I'm trying to left join in c# to find only values from Foo, that aren't in Bar. In SQL I would normally do this:
SELECT * FROM FOO f
LEFT JOIN BAR b ON f.ID = b.ID
WHERE b.ID IS NULL
With linq I normally do something like this:
var matches = Foos.Join(
Bars,
foo => foo.ID,
bar => bar.ID,
(foo, bar) => foo
).Select(x => x.ID);
and then:
var noMatch = Foos.Where(x => !matches.Contains(x.ID));
Now to the question: Is there a way to achieve this within the .Join() function?