Answer Posted / mario j vargas
You can perform a deep copy in C# by implementing the
ICloneable interface and manually assigning the values of
each member field in the current instance to the new
instance being returned. It is important to mention in the
implementation's documentation whether or not the copy is a
shallow or deep copy.
Bhagyesh suggested using a copy constructor. This is
something I had never seen in C#, only in C++, but the idea
sounded very compelling and I think this could be another
way to achieve a deep copy. You should check out the article
"How to: Write a Copy Constructor (C# Programming Guide)" in
the MSDN documentation.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Explain the use of errorprovider control in .net?
What is the difference between Session and response.Redirect?
What is asp.net version?
What will happen if the server confugration file and the application confugration file have different values for sassion state ASP.NET?
What is autopostback true?
Explain the concept of View Model in MVC?
What is active web page?
Describe how to implement globalization and localization in the use interface in .net.
How does the cookies work in asp.net?
What is cross page posting? How is it done?
What is the mvc model?
What are session and cookies?
Why we use content place holder in asp.net?
What is different in .net 1.1 and .net 2.0?
Is asp.net is a programming language?