In short, I need a JToken.Parse(string)
that don't create new instance of JToken
, but instead modifies already existing one.
My specific task requires that I don't use Jtoken.Parse(string)
, which is creating new instance of JToken
, but instead forces me to use already existing instance of JToken
that I have to populate with some data.
Initially JToken existingInstance
is an empty JToken
and I have a json string
that has data I need to put into existingInstance
.
Sorry, but I can't find any approaches here.
I tried to recursively copy one from another, but Add
only supported in JObject
There are many questions about populating already existing object of some type, but I can't find anything about populating already existing JToken
.
Example JSON file I use:
{
"type": "stated",
"width": 32,
"height": 32,
"speed": 0.1,
"states": [
{
"x": 0,
"y": 0,
"count": 4,
},{
"x": 0,
"y": 32,
"count": 4
}
]
}