Imagine you have two route templates: /products/{id} and /products/new. An incoming request has the URL /products/new. Which route will it match and why?
- /products/{id}
- /products/new
- It will not match any route
- /products/{action}
ASP.NET Core routing uses a first-match-wins strategy. In this case, the incoming request "/products/new" matches the second route "/products/new" exactly. Therefore, it will not proceed to check other routes and will be handled by the "/products/new" route.
Loading...
Related Quiz
- You've just started with ASP.NET Core and want to set up a new MVC project. Which tool or environment would you typically use to create this project?
- The @ symbol in a Razor view is used to denote the beginning of ________.
- Which file in an ASP.NET Core project typically contains project metadata, package dependencies, and project-specific settings?
- The _______ file in ASP.NET Core Razor views specifies the default layout for the views.
- You're building an application where some static files need to be accessible only for authenticated users. How might you achieve this in an ASP.NET Core application?