I am looking for a method to select ALL the objects in the JObject using Json.NET. So in short, if I had the following JSON:
{
"someCar" : {
"id" : "3",
"model" : "M7",
"engine" : "FI V8",
},
"name" : "carparkone",
"id" : "1",
"cars" : [
{
"id" : "1",
"model" : "s60",
"engine" : "i5",
},
{
"id" : "2",
"model" : "m3",
"engine" : "FI V6",
},
{
"id" : "3",
"model" : "M7",
"engine" : "FI V8",
}
]
}
I would run some command to get an array of all the objects in it, i.e. anything in {} blocks.
Ideally, I would find all the objects where someProp has some value, so only objects that have a property engine with a value of V6.
tl;dr the question:
- How do I get a list of ALL objects nested in JObject?
- (Bonus) only get objects with specific properties.