Reputation: 65
I have a long string in JSON format. This is what it looks like:
{"ShowMapUrl":true,"GameDiffusionType":5,"InputYellowCards":false,"DisplayYellowCards":false,"InputYellowCards2":false}
Note that the string is much longer. I've been trying to convert that string into a dictionary by using json.NET without success. Any tips?
Upvotes: 1
Views: 52
Reputation: 31394
Use JsonConvert.DeserializeObject<Dictionary<string, object>>()
:
var json = @"{""ShowMapUrl"":true,""GameDiffusionType"":5,""InputYellowCards"":false,""DisplayYellowCards"":false,""InputYellowCards2"":false}";
var dict = JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
Upvotes: 1