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
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

Related concepts

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.