Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How would one do a deep copy in .NET?

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


Please Help Members By Posting Answers For Below Questions

In which event of page cycle is the viewstate available?

1073


Explain security types in asp.net?

1149


How can you implement encapsulation in asp.net?

13234


Explain the use of dataadapter.

1126


What are the different types of Caching techniques in ASP.NET?

1100


What are url fragments?

945


What does session_start () do?

1158


What are the different types of cookies in asp.net?

1070


Elaborate differentiation between Cache and Application?

1016


What is meant by server side scripting?

1002


How can you handle unmanaged code exceptions in asp.net?

1141


Define common type system?

1023


What’s the use of “GLOBAL.ASAX” file?

1145


Can we use a static function with a non-static variable?

1016


What is authorization in asp.net?

1121