This project is read-only.

Unable to use entity as payload in OData action

Topics: ASP.NET Web API
Jan 8, 2014 at 3:50 PM
I've been experimenting with OData actions and have been unable to pass an entity as a payload to an action. With Content-Type: application/json it appears that ODataJsonLightParameterDeserializer.ReadNextParameter method is throwing an exception with message "The parameter '{0}' is of an unsupported type kind '{1}'. Only primitive, complex, primitive collection and complex collection types are supported.". I looked at the class in the Microsoft.Data.OData assembly and the switch statement only includes EdmTypeKinds of Primitive, Complex, and Collection, fitting the error message above. I would like to pass an entity to an action however and am curious if anyone has a workaround for this, or knows why this restriction is in place.