title: Using the field of an object as a generic Dictionary key
body: <p>If I want to use objects as the keys for a <code>Dictionary</code>, what methods will I need to override to make them compare in a specific way?</p>
  
  <p>Say I have a a class which has properties:</p>
  
  <pre><code>class Foo {
      public string Name { get; set; }
      public int FooID { get; set; }
  
      // elided
  } 
  </code></pre>
  
  <p>And I want to create a:</p>
  
  <pre><code>Dictionary&lt;Foo, List&lt;Stuff&gt;&gt;
  </code></pre>
  
  <p>I want <code>Foo</code> objects with the same <code>FooID</code> to be considered the same group.  Which methods will I need to override in the <code>Foo</code> class?</p>
  
  <p>To summarize: I want to categorize <code>Stuff</code> objects into lists, grouped by <code>Foo</code> objects. <code>Stuff</code> objects will have a <code>FooID</code> to link them to their category.</p>