Model binding

As discussed, model binding maps the data from HTTP requests to action method parameters. These parameters, like any other C# method, can be simple types, such as int, long, decimal, string, or the complex classes. ASP.NET Core MVC has abstracted this logic away from the developers so that they need not worry about this request data to parameter conversion. This conversion is done by the framework in a predefined order. Let's look at how the framework does this. The following is the code map diagram of the model binding subsystem:

Important things to notice in the diagram are:

  • ParameterBinder
  • ValueProvider factories
  • Value providers ...

Get .NET Core 2.0 By Example 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.