title: .NET dictionary with two keys and one value
body: <p>Is there a dictionary available in <code>.NET</code> that could hold 2 keys and one value.
  Like</p>
  
  <pre><code>Dictionary(Of TKey, Of TKey, TValue)
  </code></pre>
  
  <p>I have a need to store two keys and at certain times look an item by the key 1 and at other times by the key 2.</p>
  
  <p>My current solution is to maintain two dictionaries</p>
  
  <pre><code>Dictionary&lt;string, long&gt; Dict1 = new Dictionary&lt;string, long&gt;();
  Dictionary&lt;long, long&gt; Dict2 = new Dictionary&lt;long, long&gt;();
  </code></pre>
  
  <p>and when need to add item I will add it to both dictionaries.</p>
  
  <pre><code>Dict1.Add("abc", 111);
  Dict2.Add(345, 111);
  </code></pre>
  
  <p>and then I will look up an item from either one of those dictionaries depending by which one of the keys I need to look by.</p>
  
  <p>Same I will do when deleting or updating an item.</p>
  
  <p>I have thought about the composite key but I don't know how to set it up and I don't want to lose any speed of searching the item.</p>
  
  <p>Is there some solution available in <code>.NET</code> to have dictionary that can hold multiple keys?</p>