title: c# Intersect 2 lists with same but non identical objects
body: <p>I want to intersect 2 lists of objects which have the same types and same properties in it, but the objects in the list got instantiated separatly.</p>
  <pre><code>class foo
  { 
    int id;
    string name;
  
    public foo(int Id, string Name)
    {
       id = Id;
       name = Name;
    }
  }
  </code></pre>
  <pre><code>List&lt;foo&gt; listA = new List&lt;foo&gt;() {new foo(1, &quot;A&quot;), new foo(2, &quot;B&quot;), new foo(3, &quot;C&quot;)};
  List&lt;foo&gt; listB = new List&lt;foo&gt;() {new foo(2, &quot;B&quot;), new foo(3, &quot;C&quot;), new foo(4, &quot;D&quot;)};
  
  List&lt;foo&gt; intersect = listA.Intersect(listB).ToList();
  </code></pre>
  <p>foo object B &amp; C are both in listA &amp; listB but when I intersect them I get 0 entrys. I know its because there are not the same object but what do I need to do to get a list with B and C anyways?. What am I missing?</p>