Currently, generating a link for a controller extending ApiController involves the following method call:
```
Url.Link("DefaultApi", new { controller="products" id = value.Id });
```
The user needs to specify the "DefaultApi" string every time, which is error prone.
The controller token can be omitted, but it's a good rule to explicitly put it for clarity, and having it as a string is also error prone.
Consider adding an extension method that deals with Url generation for the default case:
```
Url.DefaultLink<ProductsController>(5);
```
or
```
Url.DefaultLink("products",5);
```
Comments: Closed after further investigation. It would involve an excessive coupling between the routing system and the controllers. It won't work if the user customizes the routing system.
```
Url.Link("DefaultApi", new { controller="products" id = value.Id });
```
The user needs to specify the "DefaultApi" string every time, which is error prone.
The controller token can be omitted, but it's a good rule to explicitly put it for clarity, and having it as a string is also error prone.
Consider adding an extension method that deals with Url generation for the default case:
```
Url.DefaultLink<ProductsController>(5);
```
or
```
Url.DefaultLink("products",5);
```
Comments: Closed after further investigation. It would involve an excessive coupling between the routing system and the controllers. It won't work if the user customizes the routing system.