I am using Newtonsoft's JSON Parser.
i obtain json in response. and each time it may be different. Possible variants:
1.
[
{
"type": "typing",
"updates": [
{
"__type": "qwerty"
}
]
}
]
2.
[
{
"token": 1111,
"type": "msg",
"updates": [
{
"__type": "asdfg",
....
},
{
"__type": "asdfg",
....
},
]
},
{
"type": "typing",
"updates": [
{
"__type": "qwerty"
}
]
}
]
The question is, what structure my object should have to parse any type of json?
var jToken = JToken.Parse(myResponse);
var obj = jToken.ToObject<MyObject>();
class MyObject
{
// what structure should i have here?
}