liveBook · Manning

Routing middleware

Routing middleware is an ASP.NET Core request-pipeline component that matches incoming requests to endpoints and stores the selected endpoint for subsequent processing.

How 2 Manning books explain it

ASP.NET Core in Action, 3e

UseRouting is an ASP.NET Core extension method that adds routing middleware to a web application's request pipeline.

How it is used
Selects a registered endpoint for each matching request before endpoint middleware executes it.
How deep it goes
Explains two-stage request handling and middleware placement, but defers detailed Razor Page handler selection.
Examples
Uses a `MapGet` Hello World endpoint and a Razor Pages pipeline ordered around static files and authorization.
What you can do after
Operate/configure it with `UseRouting()` when explicit placement is needed, while leaving endpoint execution to endpoint middleware.

Read how ASP.NET Core in Action, 3e explains routing middleware →

Pro ASP.NET Core 7, Tenth Edition

Routing middleware is an ASP.NET Core request-pipeline component that matches requests to endpoints and stores the selected endpoint for later processing.

How it is used
Matches request paths to endpoints in the ASP.NET Core pipeline so a selected endpoint can handle the response.
How deep it goes
Works through registration, path patterns, route values, and endpoint inspection; describes route scoring without detailing its algorithm.
Examples
Uses `/routing`, `/capital/uk`, three-segment paths, and a middleware response reporting the selected endpoint.
What you can do after
Build it from scratch with `MapGet`, read captured route values, and inspect the selected endpoint from middleware.

Read how Pro ASP.NET Core 7, Tenth Edition explains routing middleware →

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.