title: How to get the value out of this type of dictionary in c#
body: <p>I want to create, because I understand dictionaries are <code>key=&gt;value</code> in C#, a dictionary that is much like <code>key=&gt;value(key=&gt;value)</code></p>
  
  <p>Currently I I know I can do:</p>
  
  <p><code>Dictionary&lt;int, int&gt; someVar = new Dictionary&lt;int, int&gt;();</code></p>
  
  <p>which creates me a key=>value.</p>
  
  <p>To create what I want I could do (this is just a guess, please correct me if I am wrong):</p>
  
  <p><code>Dictionary&lt;int Dictionray&lt;int, int&gt;&gt; someVar = new Dictionary&lt;int, Dictionray&lt;int, int&gt;&gt;</code></p>
  
  <p>Now comes the fun part, I want to do <strong>ONE</strong> and only <strong>ONE</strong> for loop over this dictponary object <strong>YET</strong> get all values so it would look something like:</p>
  
  <pre><code>foreach (KeyValuePair&lt;int, int&gt; pair in someVar){
      //object = base dictionary key
      //object2 = nested dictionary key
      //object3 = nested dictionary value 
  }
  </code></pre>
  
  <p>Now I come from PHP so this would be dead easy to do in one for loop. what are your ideas? because I am new to C# and the term dictionary (even though php arrays are dictionaries).</p>
  
  <p>I know in C# with a for loop like this I could do: <code>pair.Key</code> and <code>pair.Value.</code></p>
  
  <p>My second part, is <strong>How do I add values to such a dictionary? I know the typical .add(bla, bla) but how do you add values to the nested part?</strong></p>