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.
Comments: Parameter attributes are not inherited in CLR i.e if you have a BaseMethod(param1) with an attribute and then override the 'BaseMethod', the attribute will not be present on param1 of overridden method. This works fine for GetEntityByKey and other methods in EntitySetController as they are not the actual actions that get invoked. The actual action is still on the base class EntitySetController and just invokes these overridden methods. So the overridden methods don't have to use any attributes. That said, we should have just followed this delegation pattern so that customers don't accidentally forget the attributes in their controllers. It kind of has an inconsistent feel right now with some methods requiring the attribute and some not.
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.
Comments: Parameter attributes are not inherited in CLR i.e if you have a BaseMethod(param1) with an attribute and then override the 'BaseMethod', the attribute will not be present on param1 of overridden method. This works fine for GetEntityByKey and other methods in EntitySetController as they are not the actual actions that get invoked. The actual action is still on the base class EntitySetController and just invokes these overridden methods. So the overridden methods don't have to use any attributes. That said, we should have just followed this delegation pattern so that customers don't accidentally forget the attributes in their controllers. It kind of has an inconsistent feel right now with some methods requiring the attribute and some not.