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

Created Unassigned: [ODataAttrRouting] $value support requires adding a route for it [1647]

$
0
0
_Scenario_: I am using OData Attribute routing on a property of an entity

Currently I need to have 2 routes for support regular request and $value based one, otherwise I get a 404 when i make a request for $value

```
[ODataRoute("Customers({key})/Name")]
[ODataRoute("Customers({key})/Name/$value")]
public async Task<IHttpActionResult> GetCustomerName(int key)
{
Customer customer = await context.Customers.FindAsync(key);
```

Ideally I would expect that specifying only the following route should be sufficient.

```
[ODataRoute("Customers({key})/Name")]
public async Task<IHttpActionResult> GetCustomerName(int key)
{
Customer customer = await context.Customers.FindAsync(key);
```

Viewing all articles
Browse latest Browse all 7215

Trending Articles