ASP.NET Core Interview Question #24

What is endpoint routing?

ASP.NET Core Fundamentals Junior Beginner

Quick Interview Answer

Endpoint routing is the routing system that selects an Endpoint for an incoming request and exposes endpoint metadata to middleware and framework components.

Detailed Explanation

Endpoint routing is the routing system that selects an Endpoint for an incoming request and exposes endpoint metadata to middleware and framework components.

Endpoints can represent controller actions, Razor Pages, minimal API handlers, SignalR hubs, health checks, and other executable destinations.

Authorization, CORS, and other middleware can use endpoint metadata to apply policies to the selected endpoint.

Code Example

app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();

app.MapControllers();
app.MapRazorPages();