title: c# Dictionary with two keys and value
body: <p>So here's the important bits, I have a dictionary with a key and value</p>
  
  <pre><code>public Dictionary&lt;int, string&gt; MyDictionary = new Dictionary&lt;int, string&gt;();
  </code></pre>
  
  <p>I can add to it with... </p>
  
  <pre><code>SomeClass.MyDictionary.Add(intValue, stringValue);
  </code></pre>
  
  <p>I can search the dictionary and retrieve stringValue with...</p>
  
  <pre><code>if (SomeClass.MyDictionary.ContainsKey(intValue))
  {
      string DictValues;
      SomeClass.MyDictionary.TryGetValues(intValue, out DictValues);
  }
  </code></pre>
  
  <p>My problem now is that I need something that can contain two keys, that I can search for independent of each other.</p>
  
  <p>This is wrong, but I'm looking for something like</p>
  
  <pre><code>public Dictionary&lt;int, int, string&gt; MyDictionary = new Dictionary&lt;int, int, string&gt;();
  SomeClass.MyDictionary.Add(intValue1, intValue2, stringValue);
  </code></pre>
  
  <p>When i run</p>
  
  <pre><code>SomeClass.MyDictionary.ContainsKey(intValue)
  </code></pre>
  
  <p>I want search both intValue1 and intValue2 independently of each other. Basically i need to know if intValue1 OR intValue2 exists in this "dictionary" so hashing them together to see if both exist isn't an option. 
  Using a tuple is not an option because I can't use the Add() function (maybe there's another way to add to tuples? unlikely).</p>
  
  <p>I tried to use an Arraylist but they only store a single object. So I thought I could put a Tuple inside but then i can't search for individual tuple items.</p>
  
  <p>I would like to avoid using two dictionaries as intValue1 and intValue2 are also a key, value pair. I need to know that intValue1 and intValue2 are related. intValue2 could be another key, and it some instances it could be a value that i need.</p>