title: swapping two key/value pairs in Dictionary of C#
body: <p>here is what I want to do.</p>
  
  <p>there is a Dictionary having 54 key/value objects. I want the key/value pair at index i to be swapped with the key/value pair at index j...</p>
  
  <pre><code>int i=1; int j=3;
  Dictionary&lt;String, int&gt; theDeck = new Dictionary&lt;String, int&gt;();
  theDeck.Add("zero",  0);
  theDeck.Add("one",   1);
  theDeck.Add("two",   2);
  theDeck.Add("three", 3);
  KeyValuePair&lt;String, int&gt; p1 = theDeck.ElementAt(i);
  KeyValuePair&lt;String, int&gt; p2 = theDeck.ElementAt(j);
  theDeck.ElementAt(i) = p2; //THIS LINE DOES NOT WORK. WHAT IS ITS ALTERNATIVE
  theDeck.ElementAt(j) = p1; //THIS LINE DOES NOT WORK. WHAT IS ITS ALTERNATIVE
  </code></pre>