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
Define repository pattern in asp.net mvc? : asp.net mvc
What is data control in asp.net?
What is special types forms
What are the advantages of using sql stored procedures instead of adhoc sql queries in an asp.net web application?
What do you mean by serialize?
What are httphandlers and httpmodules and difference between them?
What is the request flow used for asp.net mvc framework? : asp.net mvc
Why the javascript validation not run on the asp.net button but run successfully on the html button?
Mention the namespace that is used to include .net data provider for sql server in .net code?
Is asp.net a programming language?
Explain the features that make asp.net more used framework? : asp.net mvc
What is the difference between CLICK and MOUSE DOWN Event ?
What are all the various Estimation Techniques available ?
What is session in asp.net?
What types of data validation events are commonly seen in the client-side form validation?