1.

What is ASP.NET Web API routing?

Answer»

Routing is the most important part of ASP.NET Web API. Routing is a way how Web API MATCHES a URI to an action. It is basically a process that decides which action and controller should be called. The controller is basically a class that HANDLES all HTTP requests. All public methods of CONTROLLERS are basically known as action methods or just actions. Whenever a Web API framework receives any type of request, it routes that request to action. 

There are basically TWO ways to implement routing in Web API as given below:
Convention-based routing: Web API supports convention-based routing. In this type of routing, Web API uses route templates to select which controller and action method to execute. 

Attribute-based routing: Web API 2 generally supports a new type of routing known as attribute routing. As the name suggests, it uses attributes to DEFINE routes. It is the ability to add routes to the route table via attributes. 



Discussion

No Comment Found