[
{
"CRMNextFields": [
{
"FieldName": "ActiveTime",
"CastRequired": "False",
"DefaultValue": "",
"Description": "",
"FieldID": "10001567",
"KeyID": "6",
"Label": "SN_ActiveTime",
"IsMandatory": "False",
"MaxValue": "",
"MinValue": "",
"Type": "1",
"IsLookup": "False",
"LinkedFields": "",
"FieldKey": "0",
"TextFieldName": "",
"ErrorMessage": "",
"LayoutFieldId": "",
"LayoutType": "0",
"IsDNC": "",
"DNCField": "",
"ReturnType": "-1"
},
{
"FieldName": "CreatedByTypeName",
"CastRequired": "False",
"DefaultValue": "",
"Description": "",
"FieldID": "10001601",
"KeyID": "6",
"Label": "SN_CreatedByType",
"IsMandatory": "False",
"MaxValue": "",
"MinValue": "",
"Type": "2",
"IsLookup": "True",
"LinkedFields": "",
"FieldKey": "257",
"TextFieldName": "",
"ErrorMessage": "",
"LayoutFieldId": "",
"LayoutType": "-1",
"IsDNC": "",
"DNCField": "",
"ReturnType": "-1"
}
]
}
]
I want to convert this JSON to dictionary. but I'm getting some Exception while converting this.
Dictionary<object, object> values = JsonConvert.DeserializeObject<Dictionary<object, object>>(jsonResp);
Error:
Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'System.Collections.Generic.Dictionary`2[System.Object,System.Object]' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1.