liveBook · Manning

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.

How 3 Manning books explain it

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
Creates typed request inputs for minimal API endpoints and Razor Page handlers.
How deep it goes
Explains binding timing, default sources, complex objects, source attributes, failure behavior, and BindAsync customization.
Examples
Uses a square-calculating route, a currency-converter binding table, and a JSON product request.
What you can do after
Apply it via ASP.NET Core to accept typed handler inputs and select or customize their request sources.

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 →

Related concepts

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.