How to bind Json parameters to Web Api parameters in ASP.NET?
<p>When I have this method in an MVC Controller </p>

<pre><code>[HttpPost]
public async Task&lt;ActionResult&gt; MyMethod(int param1, string param2)
{
   //....
}
</code></pre>

<p>I can send a Json object <code>{param1:1, param2:"str"}</code> it works just fine and parameters are resolved. However when I do this for a WebApi 2 it doesn't work. Because <code>[FromBody]</code> can only be used by 1 parameter according to following example on documentation.</p>

<pre><code>At most one parameter is allowed to read from the message body
    // Caution: Will not work!    
    public HttpResponseMessage Post([FromBody] int id, [FromBody] string name) { ... }
</code></pre>

<p>How can we obtain the same behavior of MVC controller from WebApi controller?</p>

<p><strong>Edit</strong>: Creating corresponding classes and replacing parameters is not an option, because a messaging tool checks these methods for maintenance. Signatures should remain the same.</p>