liveBook · Manning

Route template

A route template is a URL or URI path pattern containing fixed segments and parameters that determines which requests an endpoint matches.

How 2 Manning books explain it

ASP.NET Core in Action, 3e

A route template is a URL pattern containing fixed values and optional placeholders that determines which request URLs an endpoint matches.

How it is used
Maps request URLs to endpoints while extracting variable URL values for handlers.
How deep it goes
Works through literal, required, default, and optional segments, then identifies constraints and catch-all parameters without detailing their syntax here.
Examples
Uses a name-filtering minimal API, product URLs with defaults, file-based Razor Page routes, and combined controller attributes.
What you can do after
Build it from scratch with MapGet or customize it using Razor Page directives and controller route attributes.

Read how ASP.NET Core in Action, 3e explains route template →

.NET in Action, Second Edition

A route template is a URL pattern containing segments and parameters that ASP.NET Core uses to match requests to endpoint actions.

How it is used
Routes HTTP GET requests to the appropriate controller action using URL segments and the request verb.
How deep it goes
Explains controller and segment matching with a single parameter, but defers detailed route-template rules to documentation.
Examples
Uses CatalogController, [HttpGet("{id}")], GetBook(int id), and the /catalog/1 request.
What you can do after
Apply it via ASP.NET Core attributes to distinguish collection and single-resource GET endpoints.

Read how .NET in Action, Second Edition explains route template →

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.