Model binding

The data that is carried with an HTTP request that is mapped to parameters that you define in your method's, signature in a process called Model binding. The HTTP request can contain data inside the various parts that compose it:

  • Route tokens 
  • Query strings
  • Message body
  • Request headers

ASP.NET Core's model binding defines the rules of how to map each value to its correct method parameter.     

We already saw how to bind route tokens to method parameters in the Routing section of this chapter, so we won't repeat ourselves, and will instead concentrate on the other types of bindings.

Get Hands-On Full-Stack Web Development with ASP.NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.