Parameter binding
Parameter binding is all about converting contents in an HTTP request to .NET objects so that values can be provided to action method parameters. Without parameter binding support, developers will have to write lots of error-prone and tedious code in action methods to retrieve parameter values from raw HTTP requests.
Input parameters are typically embedded in an HTTP request in URI as query strings, or in the body of the request. Web API uses a technique called Model Binding to read parameter values from the query string, and uses Formatters to read from the request body.
Model binding
If you are familiar with ASP.NET MVC, then you'll find that it's the same Model Binding concept being used in Web API for reading values from query strings, headers, or body encoded with application/form-url-encoded
. When a request is encountered, value providers registered in the ValueProviderFactories
class extracts data from the request and provides them to a model binder, which creates...