Hi All,
I'm trying to clone a class instance, which have rich collection of internal property values. Theses data are fetched from the database. I want to clone this instance in which the changes made in that instance will not affect the real one time created instance. Please refer the below code snippet:
- public class DB_Data
- {
- public DB_Data Data
- { get; internal set; }
-
- public DB_Data()
- { }
-
- public void DB_Schema()
- {
-
- }
- }
Now, I want a copy/clone of the instance which contains the DataBase data. My problem is, when I assign a new set of values to the instance, the referred instance value gets affected. Since the info fetched form the data base is a complex process, I don't want the copy variable to be initialized with real-data base info by repeated function call to the method DB_Schema(). is there any way to do this?
Kindly share your ideas. Thanks in advance.
Regards,
Amresh S.