title: What requirements on type used in IEnumerable.GroupBy()?
body: <p>I was using <code>GroupBy</code> with an anonymous type:</p>
  
  <pre><code>var v = list.GroupBy(x =&gt; new {x.street, x.houseNumber});
  var o = v.Single(x =&gt; x.Key.street == "My Street" &amp;&amp; x.Key.houseNumber == 42);
  </code></pre>
  
  <p>It worked great. I decided to turn this into a concrete type:</p>
  
  <pre><code>class StreetAddress
  {
   public StreetAddress(string _street,int _houseNumber){...}
   public string street{get; set;}
   public int houseNumber{get;set;}
  }
  var v = list.GroupBy(x =&gt; new StreetAddress(x.street, x.houseNumber));
  var o = v.Single(x =&gt; x.Key == new StreetAddress("My Street", 42));
  </code></pre>
  
  <p>Now 'v' is not grouped at all - loads of items with the same <code>Key</code> value, and <code>o</code> doesn't match any objects.</p>
  
  <p>What do I need to add to <code>StreetAddress</code> so this works as it did with an anonymous type?</p>