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 different types of validators in asp.net?
What are uri parameters?
How can u deifne the benefits and limitation of using Viewstate for state management?
What is the use of autowireup in asp.net?
Why mvc is better than asp.net? : Asp.Net MVC
What are the different web pages?
What’s the catch?
What is ipostback?
How do u declare static variable and how it is declared and what is its lifetime?
How do we sort the data from a dataset?
How do session tokens work?
What's the use of response.output.write()?
What does occur first in ASP.Net, Authentication or Authorization?
i want the asp.net technical questions and answeres
Can you explain the importance of finalize method in .net?