How Can set default Parameter Binding in ASP.NET Core Web API

436 Views Asked by At

In all of my API [HttpPost] methods, I have to put [FromBody] before arguments and it is repeated work! for example:

    [HttpPost]
    public async Task<JsonResult> Method([FromBody]MyModel model)
    {
        //CODE
        return Json(result);
    }

Is there any special setting or trick that say to Web API, your default Parameter Binding of [HttpPost] is [FromBody]?

0

There are 0 best solutions below