title: specifying deserialization in Json.NET
body: <p>I have somewhat deep Json structure like below incoming over the wire into C# application: :</p>
  
  <pre><code>[
  {
      "status": "ok",
      "node": "vm2",
      "type": "message",
      "result": {
          "tx.mqid": "amq.gen-+Phq5acfC9kbs7Ch/0cUUw==",
          "tx.time": 1297273910,
          "tx.id": 28
      }
  }
  ...
  ]
  </code></pre>
  
  <p>I'm doing deserialization like this:</p>
  
  <pre><code>List&lt;Hashtable&gt; des = JsonConvert.DeserializeObject&lt;List&lt;Hashtable&gt;&gt;(objs);
  </code></pre>
  
  <p>Now, I need to extract "result" dictionary from the structure above.</p>
  
  <p>The problem with doing it is that it's not always there. It may be replaced with something else, esp. when error happens. Also, result may change depending on what function was called by Json client. So I can't really specify it in static fashion like this:</p>
  
  <pre><code>JsonConvert.DeserializeObject&lt;List&lt;Hashtable&lt;Hashtable&gt;&gt;&gt;
  </code></pre>
  
  <p>For now I'm doing deserialization in somewhat boneheaded manner, like this:</p>
  
  <pre><code>JObject nodeResult = (JObject)nodeRec["result"];
  Hashtable nrh = JsonConvert.DeserializeObject&lt;Hashtable&gt;(nodeResult.ToString());
  </code></pre>
  
  <p>That is, I'm deserializing "result" into JObject, then serializing it into text, and then deserializing it into Hashtable.</p>
  
  <p>Is there any way to convert JObject directly into Hashtable, or make structures nested deeply in the json text like "result" into Hashtable to begin with? The above approach works, but I hate its clunkiness.</p>