Q:

Convert Json to Dictionary C#

I want transform this json in Dictionary for make one loop
Look my code:
string json = @"{""name"":""Joe"",""note"":{""a1"":10,""a2"":9,""a3"":5}}";

Dictionary<string, object> dictionaryLevelOne = JsonConvert.DeserializeObject<Dictionary<string, object>>(json);   
Dictionary<string, object> dictionaryLevelTwo = JsonConvert.DeserializeObject<Dictionary<string, object>>(dictionaryLevelOne ["note"]);

A:

You need to pass dictionaryLevelOne["note"] as a string.
string json = @"{""name"":""Joe"",""note"":{""a1"":10,""a2"":9,""a3"":5}}";

Dictionary<string, object> dictionaryLevelOne = JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
Dictionary<string, object> dictionaryLevelTwo = JsonConvert.DeserializeObject<Dictionary<string, object>>(dictionaryLevelOne["note"].ToString());

