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 different types of validators in asp.net?

954


What are uri parameters?

986


How can u deifne the benefits and limitation of using Viewstate for state management?

1086


What is the use of autowireup in asp.net?

1006


Why mvc is better than asp.net? : Asp.Net MVC

887


What are the different web pages?

863


What’s the catch?

1042


What is ipostback?

1014


How do u declare static variable and how it is declared and what is its lifetime?

973


How do we sort the data from a dataset?

911


How do session tokens work?

898


What's the use of response.output.write()?

1218


What does occur first in ASP.Net, Authentication or Authorization?

984


i want the asp.net technical questions and answeres

2010


Can you explain the importance of finalize method in .net?

981