title: Exception converting JSON.NET JObject to JsonResult
body: <p>I have a JSON.NET JObject with data structured like this:</p>
  
  <pre><code>{
      "foo" : {
          "bar": "baz"
      }
  }
  </code></pre>
  
  <p>I'm trying to convert it to a ASP.NET MVC JsonResult as follows:</p>
  
  <pre><code>JObject someData = ...;
  JsonResult jsonResult = Json(someData, "application/json", JsonRequestBehavior.AllowGet);
  </code></pre>
  
  <p>When I do this, I get the following exception:</p>
  
  <blockquote>
    <p>InvalidOperationException was
    unhandled by user code. Cannot access
    child value on
    Newtonsoft.Json.Linq.JValue.</p>
  </blockquote>
  
  <p>I have a workaround, in that I can iterate through all of the properties of the JObject, and parse them into a generic object like so:</p>
  
  <pre><code>JsonResult jsonResult = Json(new { key1 = value1, key2 = value2, ... });
  </code></pre>
  
  <p>However, this seems error prone and like an unnecessary non-generic way of solving this problem. Is there any way I can do this more efficiently, hopefully using some built in methods in JSON.NET or ASP.NET MVC?</p>