简体   繁体   中英

clone a class object into a object of same class

I have a class lets say students

with properties as

public string sname{get;set;}
public int sid{get;set;}
public studentprofile sprofile{get;set;}

where student profile is another class with some other properties .

I want to do deep copy of the students object.

How to do that.

I think this is already answered. Have a look at this solution : How do you do a deep copy of an object in .NET (C# specifically)?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM