title: Get .NET Core JSON Body as dynamic object
body: <p>My ASP.NET Core endpoint accepts a JSON form as its input and calls a method that expects a dynamic argument. I am attempting to call the method like this:</p>
  <pre class="lang-cs prettyprint-override"><code>[HttpPost]
  public IActionResult InitializeAction([FromBody] dynamic jsonData)
  {
      return this.Ok(this.MyMethod(jsonData));
  }
  </code></pre>
  <p>When I POST the JSON <code>{&quot;test&quot;: &quot;value&quot;}</code> to this method, I would expect identical behavior to doing the following:</p>
  <pre class="lang-cs prettyprint-override"><code>[HttpPost]
  public IActionResult InitializeAction([FromBody] dynamic jsonData)
  {
      return this.Ok(this.MyMethod(new {test = &quot;value&quot;}));
  }
  </code></pre>
  <p>However, the JSON value retrieved using the <code>[FromBody]</code> parameter does not get converted to a standard .NET dynamic argument, and is instead a <code>JsonDocument</code> or <code>JsonElement</code> or something along those lines.</p>
  <p>How do I receive or serialize the JSON from the HTTP Post as a .NET dynamic object?</p>