Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Issue: Consider adding an extension method for generating links to ApiController more easily [928]

$
0
0
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);
```

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>