Allows you to map JSON object directly to controller action parameters. Convert JSON model
{ "a": "a", "b": { "c": "value" } }
directly to action method
public ... Method(string a, dynamic b)
Nested objects are supported as dynamic types (with limitations).
Step 1.
Add attribute JsonParameters
to your action
[HttpPost("two")]
[JsonParameters]
public async Task<IActionResult> TwoParameters(string a, dynamic b)
{
Console.WriteLine(b.c);
return Ok();
}
Step 2. Enhoy simplified workflow.
Thanks to tchivs for providing code to map to dynamic types