title: How to copy a dictionary containing reference type for value to another dictionary in C#
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/139592/what-is-the-best-way-to-clone-deep-copy-a-net-generic-dictionarystring-t">What is the best way to clone/deep copy a .NET generic Dictionary&lt;string, T&gt;?</a>  </p>
  </blockquote>
  
  
  
  <p>Hi there! I stuck on something and I really need help :(
  So I have a dictionary </p>
  
  <pre><code>Dictionary&lt;string, MyClass&gt; dict = new Dictionary&lt;string, MyClass&gt;();
  </code></pre>
  
  <p>Where MyClass is some class with properties, methods and so on. When I try to copy this dictionary to another, for instance:</p>
  
  <pre><code>Dictionary&lt;string, MyClass&gt; newDict = new Dictionary&lt;string, MyClass&gt;(dict);
  </code></pre>
  
  <p>It seems that the data is copied by reference and when I try to update any MyClass object in the newDict, the data is updated and in dict. So how can I copy one dictionary to another and when I try to update the data in the copy, the data in the original stays the same?</p>
  
  <p>Thanks in advance :)
  Have a nice day :)</p>