title: Deserialize JSON to dictionary using LINQ to JSON
body: <p>I have some JSON like this (serializes from a dictionary):</p>
  
  <pre><code>{
    "Context":
    {
      "Test": "Test"
    }
  }
  </code></pre>
  
  <p>And would like to use JSON.NET's JSON to LINQ to deserialize it into a dictionary.</p>
  
  <p>I've tried something different things:</p>
  
  <pre><code>var obj = JObject.Parse(json);
  obj.Value&lt;Dictionary&lt;string, string&gt;&gt;("Context");
  </code></pre>
  
  <p>But this throws an exception like this:</p>
  
  <blockquote>
    <p>System.InvalidCastException<br>
    Cannot cast Newtonsoft.Json.Linq.JObject to Newtonsoft.Json.Linq.JToken</p>
  </blockquote>
  
  <p>I've have also tried:</p>
  
  <pre><code>var obj = JObject.Parse(json);
  var context = obj.Values("Context");
  </code></pre>
  
  <p>But then I can't figure out how to process the elements into a dictionary.</p>