How can I copy a Dictionary<string, string> to another new Dictionary<string, string> so that they are not the same object?
How can I copy a Dictionary<string, string> to another new Dictionary<string, string> so that
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you mean you want them to be individual objects, and not references to the same object pass the source dictionary into the destination’s constructor:
"so that they are not the same object."
Ambiguity abound – if you do actually want them to be references to the same object:
(Changing either
dord2after the above will affect both)