how to change Dictionary's value when enumerate it?
<p>how to change Dictionary's value when enumerate it? 
the following code doesn't work, because we can not change dictionary's value when enumerating it. Is there any way to get around it? Or NO WAY? Thanks</p>

<pre><code>foreach (KeyValuePair&lt;string, int&gt; kvp in mydictionary)
        {
            if (otherdictionary.ContainsKey(kvp.Key))
            {
                mydictionary[kvp.Key] = otherdictionary[kvp.Key];

            }
            else
            {
                otherdictionary[kvp.Key] = mydictionary[kvp.Key];
            }
        }
</code></pre>
