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: [Fixed](https://aspnetwebstack.codeplex.com/SourceControl/changeset/74b3c6c6a6bd3ba76aa2af0d1a740d4e51d9f9dc)

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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