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

Edited Issue: Overriden CreateLink method does not work [888]

$
0
0
I derive my controller class from EntitySetController<TEntity, TKey>

I have overriden the CreateLink method of base class:

```
public override void CreateLink(int key, string navigationProperty, Uri link)
{
}
```


The link parameter argument is always passed in as null, even though the body contains an Url:
```
POST http://localhost:34852/Channels(1)/$links/SIGNALS HTTP/1.1
Accept: application/json;odata=minimalmetadata
DataServiceVersion: 3.0,3.0;
MaxDataServiceVersion: 3.0
Content-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
Host: localhost:34852
Content-Length: 53
Expect: 100-continue

{
"url":"http://localhost:34852/Signals(20000)"
}
```

Workaround:
It only works correctly by specifying again the [FromBody] attribute in the method signature of overriden method:

```
public override void CreateLink(int key, string navigationProperty, [FromBody] Uri link)
{
}
```

I believe this is a bug, since the mechanism works with the key parameter, where [FromODataUri] attribute is specified in the base class and I do not have to repeat it in overidden method.


Viewing all articles
Browse latest Browse all 7215

Trending Articles



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