I have two List of two different custom types. Both types share 2 common properties.
For example:
List<foo>;
List<bar>;
They both have properties, for example, named Name and Age.
I want to return a new List containing all bar objects, where the Name and Age properties of bar are present in any of the foo objects.
What would be the best way to do this?
Thanks
Assuming the shared properties implement equality etc properly, you might want to do something like:
The other options using joins will certainly work – but I find this clearer for the expressing the idea that you only want to look at each
barentry once, even if there are severalfooitems with that property.