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

Commented Issue: OData actions do not work if the model has KeyValuePair. [1232]

$
0
0
1) Create a model having an ODataAction.
2) Add a complex type KeyValuePair<string, object> to the model like this,
model.ComplexType<KeyValuePair<string, object>>();


3) Try accessing that action. ODataFormatter fails with model state error,

```
{Microsoft.Data.OData.ODataException: A top-level property with name 'IsUser' was found in the payload; however, property and collection payloads must always have a top-level property with name 'value'.
```

This is because ODataActionParameters is IDictionary<string, object> which is IEnumerable<KeyValuePair<string, object>>. So ODataFormatter thinks that ODataActionParameters is a EDM collection type.
Comments: TristanKazu: No problem. Thanks for reporting this and trying out the fix.

Viewing all articles
Browse latest Browse all 7215

Trending Articles