Ok, so I have two lists of items which are of different types.
var whales = new List<Whale>();
var crabs = new List<Crab>();
So they both have the id property. So save the lists have objects with Ids of:
whales: 1, 3, 4, 5 crabs: 1, 2, 3, 4
Ok so I have a query:
var matchedPairs = from c in crabs
from w in whales
where c.Id = w.Id
select new { crab = c, whale = w };
So that works fine for getting the matches. Where I'm having trouble is I want to get a list of crabs that don't have a matching whale ie. Crab Id = 2. Then I want to get the whales that don't have a matching crab ie Whale Id = 5.
Can anyone tell me how to write these queries?