There are several ways that you can extract your key/value pairs to construct a dictionary:
var dict = "[{\"key\":\"60236\",\"value\":\"1\"},
{\"key\":\"60235\",\"value\":\"gdsfgdfsg\"},
{\"key\":\"60237\",\"value\":\"1\"}]";
Use List<KeyValuePair<int, string>>
var dictionary = JsonConvert.DeserializeObject<List<KeyValuePair<int, string>>>(dict)
.ToDictionary(x => x.Key, y => y.Value);
Use a custom object that represents your pairs and then create a dictionary from your collection.
var output = JsonConvert.DeserializeObject<List<Temp>>(dict);
var dictionary = output.ToDictionary(x => x.Key, y => y.Value);
public class Temp
{
public int Key { get; set; }
public string Value { get; set; }
}
Finally, if you're uncomfortable with using a custom "throwaway" object just for deserialization, you can take a tiny performance hit and use dynamic instead.
var dictionary = JsonConvert.DeserializeObject<List<dynamic>>(dict)
.ToDictionary (x => (int)x.key, y => (string)y.value);