I have a json as shown below -
"thothTest":{
"9876":[
"K"
],
"5431":[
"A",
"L"
],
"5123":[
"L"
]
}
This is how I get thothTest
value. Now I am trying to print each key and their values by iterating json array. Like I want to print 9876
and its whole array by iterating it over them. Similarly for other entries.
var parsedthothTests = parsed["thothTest"];
foreach (var parsedthothTest in parsedthothTests)
{
Console.WriteLine(parsedthothTest); // this prints innermost array one by one
foreach (var val in parsedthothTest.Values)
{
}
}
In my innermost foreach loop it gives me error as - Foreach cannot operate on a 'method group'. Did you intend to invoke the 'method group'?
What is wrong I am doing here?