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

Explain the use of errorprovider control in .net?

963


What is the difference between Session and response.Redirect?

1129


What is asp.net version?

985


What will happen if the server confugration file and the application confugration file have different values for sassion state ASP.NET?

1232


What is autopostback true?

1062


Explain the concept of View Model in MVC?

1022


What is active web page?

950


Describe how to implement globalization and localization in the use interface in .net.

961


How does the cookies work in asp.net?

1165


What is cross page posting? How is it done?

963


What is the mvc model?

1010


What are session and cookies?

981


Why we use content place holder in asp.net?

1036


What is different in .net 1.1 and .net 2.0?

1014


Is asp.net is a programming language?

942