I have a dictionary like this :
{
"A" : {
"A1" : {
"er" : false,
"hy" : false,
"fv" : false,
"fr" : false
},
"A2" : {
"fr" : false,
"ty" : false,
"ty" : false,
},
"B" : {
"B1" : {
"er" : false,
"hy" : false,
"fv" : false,
"fr" : false
},
"B2" : {
"fr" : false,
"ty" : false,
"ty" : false,
},
}
}
I am trying to retrieve values of A and B dictionary as a separate dictionaries
I have tried
Dictionary<string, object> dict =
jss.Deserialize<Dictionary<string, object>>(json);
Dictionary<string, object> dict1 = dict["A"];//error over here
Cannot implicitly convert type ‘object’ to ‘System.Collections.Generic.Dictionary’. An explicit conversion exists (are you missing a cast?)
how to resolve this?
Try this: