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
What is difference cookie and session?
What is form method?
What is smpte vc-1?
What is asp.net? How is it different from asp?
Why we use content place holder in asp.net?
What is the difference between web config and machine config files?
Explain how does asp page work?
How to Insert/Add in ASPXgridview
How do you declare delegates and are delegates and events one and the same and explain how do you declare delegates and invoke them ?
Can you edit data in the Repeater control? Which template must you provide, in order to display data in a Repeater control? How can you provide an alternating color scheme in a Repeater control? What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?
Describe session handling in a webfarm, how does it work and what are the limits?
What is meant by web application?
How many validators do ASP.NET have?
What is the asp.net mvc folder conventions? : asp.net mvc
What does passport and windows authentication mean in ASP.NET?