Skip to main content

What is Routing in ASP.NET Core and how does Endpoint Routing work?

Mid .NET Core
Quick Answer Routing matches HTTP requests to endpoints. Endpoint Routing (current) separates matching (UseRouting) from execution (UseEndpoints/MapControllers). This allows middleware between matching and execution to use route data รขโ‚ฌโ€ like authorization middleware reading route metadata. Attribute routing ([Route], [HttpGet]) gives explicit control per action.

Answer

Routing maps URLs to endpoints (controllers/pages). Endpoint Routing performs early route matching and delays execution until UseEndpoints(). It allows metadata-driven policies (auth, CORS) and improves performance.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice