attribute routing

Declaring a controller's routes with attributes such as [Route("api/products")] and [HttpGet("{id:int}")] on the class and its actions.

In more detail

Attributes on the class set a prefix, and attributes on each action add the rest of the path and the HTTP method. The URL shape then sits right next to the code that handles it.

Related terms

Taught in

References