# Attribute Routing

*noun*

say it: **“AT-rih-byoot ROW-ting”** **/ˈætrɪbjuːt ˈraʊtɪŋ/**

Setting a controller action's address with an attribute on it, such as \[HttpGet("products/{id}")\].

## What is **Attribute Routing**?

**Attribute routing** puts the URL pattern right on the controller or method with `[Route]`, `[HttpGet("...")]` and friends.

```csharp
[Route("api/orders")]
public class OrdersController : ControllerBase
{
    [HttpGet("{orderId:int}/items")]
    public IActionResult Items(int orderId) => Ok();
}
```

## In a sentence

- “With **attribute routing**, the address sits right above the action it calls.”

Level: Apprentice · [More ASP.NET Core terms at this level](https://www.ask-codey.com/glossary?category=aspnet-core&level=2)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/attribute-routing
