c# json to dictionary

43

c# json to dictionary -

string json = @"{""key1"":""value1"",""key2"":""value2""}";

var values = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

c# dictionary to json -

return JsonConvert.SerializeObject( myDictionary );

deserialize object to dictionary c# -

string json = @"{""key1"":""value1"",""key2"":""value2""}";

var values = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

Comments

Submit
0 Comments