I'd like to propose the ability to "freeze" a JToken
. A frozen JToken
is essentially read-only; any attempt to change one of its properties results in an InvalidOperationException
.
JToken
" refers to any instance of a class derived from JToken
.JToken
is initially created, it is not frozen.JToken
is frozen, all children of the JToken
are frozen as well.No changes would be made to any current public API.
I would be happy to implement this functionality and send a pull request if you like the idea.
This is a little easier now that there is JsonLoadSettings. Could add a flag to that that loaded tokens should be frozen.
Any news on this? I just stumbled into a problem which I could solve nicely with immutable JObjects
Any update with this one?
Most helpful comment
Any news on this? I just stumbled into a problem which I could solve nicely with immutable JObjects