When I do the following.. anything done to Person b modifies Person a (I thought doing this would clone Person b from Person a). I also have NO idea if changing Person a wil
It couldn't be simpler than this:
public SomeClass Clone () { var clonedJson = JsonConvert.SerializeObject (this); return JsonConvert.DeserializeObject (clonedJson); }
Just serialize any object to a JSON string and then deserialize it. This will do a deep copy...