C# Linq intersect/except with one part of object
问题 I\'ve got a class: class ThisClass { private string a {get; set;} private string b {get; set;} } I would like to use the Intersect and Except methods of Linq, i.e.: private List<ThisClass> foo = new List<ThisClass>(); private List<ThisClass> bar = new List<ThisClass>(); Then I fill the two lists separately. I\'d like to do, for example (and I know this isn\'t right, just pseudo code), the following: foo[a].Intersect(bar[a]); How would I do this? 回答1: Maybe // returns list of intersecting