title: Using LINQ to objects Intersect and Except on a specific property
body: <p>When I have 2 <code>List&lt;string&gt;</code> objects, then I can use <code>Intersect</code> and <code>Except</code> on them directly to get an output <code>IEnumerable&lt;string&gt;</code>. That's simple enough, but what if I want the intersection/disjuction on something more complex?</p>
  
  <p>Example, trying to get a collection of <code>ClassA</code> objects which is the result of the intersect on <code>ClassA</code> object's <code>AStr1</code> and <code>ClassB</code> object's <code>BStr</code>; :</p>
  
  <pre><code>public class ClassA {
      public string AStr1 { get; set; }
      public string AStr2 { get; set; }
      public int AInt { get; set; }
  }
  public class ClassB {
      public string BStr { get; set; }
      public int BInt { get; set; }
  }
  public class Whatever {
      public void xyz(List&lt;ClassA&gt; aObj, List&lt;ClassB&gt; bObj) {
          // *** this line is horribly incorrect ***
          IEnumberable&lt;ClassA&gt; result =
              aObj.Intersect(bObj).Where(a, b =&gt; a.AStr1 == b.BStr);
      }
  }
  </code></pre>
  
  <p>How can I fix the noted line to achieve this intersection.</p>