title: Composite Key Dictionary
body: <p>I have some objects in List, let's say <code>List&lt;MyClass&gt;</code> and MyClass has several properties.  I would like to create an index of the list based on 3 properties of of MyClass.  In this case 2 of the properties are int's, and one property is a datetime.</p>
  
  <p>Basically I would like to be able to do something like:</p>
  
  <pre><code>Dictionary&lt; CompositeKey , MyClass &gt; MyClassListIndex = Dictionary&lt; CompositeKey , MyClass &gt;();
  //Populate dictionary with items from the List&lt;MyClass&gt; MyClassList
  MyClass aMyClass = Dicitonary[(keyTripletHere)];
  </code></pre>
  
  <p>I sometimes create multiple dictionaries on a list to index different properties of the classes it holds.  I am not sure how best to handle composite keys though.  I considered doing a checksum of the three values but this runs the risk of collisions.</p>