I am trying to convert my json array into key/value pairs in a Dictionary but I keep getting my Keys and Values as null.
Exception : System.ArgumentNullException: 'Value cannot be null. Parameter name: key' I am trying to get them as
"Key" : Value "Key" : Value Here is the Json
[ { "id": 1, "name": "David", "type": 0 }, { "id": 12, "name": "John", "type": 0, } ] I have tried the following
var value = JsonConvert.DeserializeObject<List<KeyValuePair<string, object>>>(jsonString).ToDictionary(x => x.Key, y => y.Value);