JSON.NET: Obtain JObject from JProperty Value
<p>I'm stuck on something: </p>

<p>I deserialized a JSON file using JObject.Load:</p>

<pre><code>// get the JSON into an object 
JObject jsonObject = JObject.Load(new
  JsonTextReader(new StreamReader("mydoc.json")));
</code></pre>

<p>Fine. I now have a populate jsonObject. </p>

<p>Now I iterate through its properties like this:</p>

<pre><code>foreach (JProperty jsonRootProperty in jsonObject.Properties())
  {    
    if (jsonRootProperty.Name=="Hotel")
    {
      ... !!! I just want a JObject here...
    }
  }
</code></pre>

<p>Once I find a property with a Name equal to "Hotel", I want that property's value as a JObject. The catch is that the Hotel property name might be a single value (say, a string), or it might be a JSON object or a JSON array.</p>

<p>How can I get the property's value into a JObject variable so that I can pass it to another function that accepts a JObject parameter?</p>