When I parse the json string
var testJson = @"{'entry1': {
'49208118': {
'name': 'just a name'
}
},
'entry2': {
'49208118': [
{
'description': 'just a description'
},
{
'description': 'another description'
}
]
}
}";
using
dynamic conversionResult = JsonConvert.DeserializeObject(testJson);
I can easily access the first level entries using
Assert.IsNotNull(conversionResult.entry1);
Assert.IsNotNull(conversionResult.entry2);
But how can I access the subentries of each entry?
conversionResult.entry1.49208118.name;
Obviously does not work.
Please note: the string is a simplified version of a json string retrieved from an API and the subentry id '49208118' is completely random and changes each time the API is called.