ankur
ankur

Reputation: 4733

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.

Upvotes: 0

Views: 200

Answers (1)

Abdel Raoof Olakara
Abdel Raoof Olakara

Reputation: 19353

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)?

Upvotes: 1

Related Questions