Model binding
Model binding is the process of locating incoming data, converting it to appropriate types, and assigning it to application objects or handler parameters.
ASP.NET Core in Action, 3e
A model binder is the framework component that locates request values, converts them to appropriate types, and assigns them to bound objects or parameters.
- How it is used
- Supplies typed request data to minimal API endpoints and Razor Page handlers.
- How deep it goes
- Explains binding sources, type conversion, failure behavior, and customization, with distinct conventions for minimal APIs and Razor Pages.
- Examples
- Uses a square endpoint, a JSON product request, and Razor Page handlers with bound properties.
- What you can do after
- Apply it via ASP.NET Core to bind request values, select sources, and customize parameter binding.
Read how ASP.NET Core in Action, 3e explains model binding →
Pro ASP.NET Core 7, Tenth Edition
A model binder is an ASP.NET Core component that converts request data into objects or values supplied to application handlers.
- How it is used
- Turns request data into typed parameters and properties for controller actions and Razor Page handlers.
- How deep it goes
- Works through source order, simple and nested types, collections, defaults, property selection, and over-binding; manual binding is listed but not demonstrated here.
- Examples
- Uses an RSVP form, a product form with nested fields, collection inputs, and a product API binding target.
- What you can do after
- Build it from scratch by declaring binding targets, matching input names, handling missing values, and restricting client-settable properties.
Read how Pro ASP.NET Core 7, Tenth Edition explains model binding →
Building Web APIs with ASP.NET Core
Model binding is the ASP.NET Core mechanism that maps incoming request data to action-method parameters and performs framework-managed type conversion and default handling.
- How it is used
- Maps board-game API request values to typed action inputs so pagination, sorting, and filtering requests can be handled.
- How deep it goes
- Walks through string conversion, defaults, DTO property binding, validation, and request flow without implementing a binder.
- Examples
- Uses a paginated GET request, a RequestDTO with [FromQuery], and a [Range] page-size limit.
- What you can do after
- Apply it via ASP.NET Core action parameters, query-bound DTOs, and validation attributes to accept typed inputs and reject invalid ones.
Read how Building Web APIs with ASP.NET Core explains model binding →
Also covered in
What to know first
- HTTP GETHTTP GET is a safe, idempotent HTTP method that requests a representation of a resource without intending to change its state.
- JSONJSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
- attributeAn attribute is a named property or piece of information associated with an entity, object, or structured data item.
Related concepts
- HTTP requestuses · An HTTP request is a message sent by a client to a server using the Hypertext Transfer Protocol, specifying a method and target and optionally including headers and a body.
- FromQuery attributeconfigured by · The FromQuery attribute directs ASP.NET Core model binding to obtain a parameter or property value from the request URL's query string.
- BindProperty attributeconfigured by · The BindProperty attribute is an ASP.NET Core attribute that enables binding a Razor PageModel property from incoming request data.
- FromHeader attributeconfigured by · The FromHeader attribute directs ASP.NET Core model binding to obtain a parameter or property value from an HTTP request header.
- structuses · A struct is a named composite type or data structure that groups multiple fields or values into one structured unit.
Questions about model binding
What is model binding?
Model binding is the process of locating incoming data, converting it to appropriate types, and assigning it to application objects or handler parameters.
Which Manning books explain model binding?
ASP.NET Core in Action, 3e, Pro ASP.NET Core 7, Tenth Edition and Building Web APIs with ASP.NET Core.
What should I know before learning model binding?
Manning books that teach model binding usually introduce HTTP GET, JSON, attribute and C# first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


