title: JSON to Dictionary c#
body: <pre><code>[
    {
      &quot;CRMNextFields&quot;: [
        {
          &quot;FieldName&quot;: &quot;ActiveTime&quot;,
          &quot;CastRequired&quot;: &quot;False&quot;,
          &quot;DefaultValue&quot;: &quot;&quot;,
          &quot;Description&quot;: &quot;&quot;,
          &quot;FieldID&quot;: &quot;10001567&quot;,
          &quot;KeyID&quot;: &quot;6&quot;,
          &quot;Label&quot;: &quot;SN_ActiveTime&quot;,
          &quot;IsMandatory&quot;: &quot;False&quot;,
          &quot;MaxValue&quot;: &quot;&quot;,
          &quot;MinValue&quot;: &quot;&quot;,
          &quot;Type&quot;: &quot;1&quot;,
          &quot;IsLookup&quot;: &quot;False&quot;,
          &quot;LinkedFields&quot;: &quot;&quot;,
          &quot;FieldKey&quot;: &quot;0&quot;,
          &quot;TextFieldName&quot;: &quot;&quot;,
          &quot;ErrorMessage&quot;: &quot;&quot;,
          &quot;LayoutFieldId&quot;: &quot;&quot;,
          &quot;LayoutType&quot;: &quot;0&quot;,
          &quot;IsDNC&quot;: &quot;&quot;,
          &quot;DNCField&quot;: &quot;&quot;,
          &quot;ReturnType&quot;: &quot;-1&quot;
        },
        {
          &quot;FieldName&quot;: &quot;CreatedByTypeName&quot;,
          &quot;CastRequired&quot;: &quot;False&quot;,
          &quot;DefaultValue&quot;: &quot;&quot;,
          &quot;Description&quot;: &quot;&quot;,
          &quot;FieldID&quot;: &quot;10001601&quot;,
          &quot;KeyID&quot;: &quot;6&quot;,
          &quot;Label&quot;: &quot;SN_CreatedByType&quot;,
          &quot;IsMandatory&quot;: &quot;False&quot;,
          &quot;MaxValue&quot;: &quot;&quot;,
          &quot;MinValue&quot;: &quot;&quot;,
          &quot;Type&quot;: &quot;2&quot;,
          &quot;IsLookup&quot;: &quot;True&quot;,
          &quot;LinkedFields&quot;: &quot;&quot;,
          &quot;FieldKey&quot;: &quot;257&quot;,
          &quot;TextFieldName&quot;: &quot;&quot;,
          &quot;ErrorMessage&quot;: &quot;&quot;,
          &quot;LayoutFieldId&quot;: &quot;&quot;,
          &quot;LayoutType&quot;: &quot;-1&quot;,
          &quot;IsDNC&quot;: &quot;&quot;,
          &quot;DNCField&quot;: &quot;&quot;,
          &quot;ReturnType&quot;: &quot;-1&quot;
        }
      ]
    }
  ]
  </code></pre>
  <p>I want to convert this JSON to dictionary.
  but I'm getting some Exception while converting this.</p>
  <pre><code>Dictionary&lt;object, object&gt; values = JsonConvert.DeserializeObject&lt;Dictionary&lt;object, object&gt;&gt;(jsonResp);
  </code></pre>
  <p>Error:</p>
  <blockquote>
  <p>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. {&quot;name&quot;:&quot;value&quot;}) to deserialize correctly.</p>
  <p>To fix this error either change the JSON to a JSON object (e.g. {&quot;name&quot;:&quot;value&quot;}) 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.</p>
  <p>Path '', line 1, position 1.</p>
  </blockquote>