I have 3 tables. 2 contain lists of files that I need to do a UNION on to get all the unique files, then I want to do a left outer join against the 3rd table to find all the files that are in the 3rd table only and not in the other 2.
To do the UNION I have the following:
var imageUnion = (from img in dc.ImageT1
select img.filename).Union(
from img in dc.ImageT2
select img.filename);
Now, to get the files only in the 3rd table I would do a left outer join as such:
var query = from image in dc.ImageT1
join active in dc.ActiveImages on image.filename equals
active.filename into gj
from subimage in gj.DefaultIfEmpty()
where subimage.filename == null
select new { image.filename, image.size };
I understand how to do the left outer join simply against ONE table, but how do I get the result set of my first query into the left outer join? Basically, instead of doing the left outer join against ImagesT1 I want to do it against the imageUnion result.
Thanks!