This project has moved and is read-only. For the latest updates, please go here.

Add DeepClone method to JToken

Nov 30, 2010 at 6:41 PM

A DeepClone method on JToken would be nice. It looks like there is already an internal CloneToken method, so presumably it could just call that.

Here is my workaround, but it probably isn't as efficient as calling CloneToken.

public static class JTokenUtility
    public static JToken DeepClone(this JToken token)
        return JToken.ReadFrom(token.CreateReader());

Dec 27, 2010 at 9:26 PM

Done. JToken now also implements ICloneable.