Model binding source inference determines where an action parameter gets its value. With [ApiController], complex parameters are inferred from the request body, so JSON input usually needs no explicit [FromBody] attribute. section 20.4
A simpler JSON update action
A FruitController action can accept UpdateModel directly: public ActionResult Update(UpdateModel model). [ApiController] supplies the body-binding convention that would otherwise require [FromBody]. The same attribute also handles invalid model state automatically. section 20.4
The convention changes the controller’s expected behavior:
- Without [ApiController], complex types are assumed to come from form values and JSON binding ordinarily requires [FromBody]. section 20.4
- With [ApiController], API actions follow the body-binding convention and invalid model state can produce automatic 400 responses. section 20.4
