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

Closed Issue: Error serializing return type of NON-bindable action [485]

$
0
0
I have the following NON-bindable action configuration on Product entity:

ActionConfiguration extendSupportAction = new ActionConfiguration(modelBuilder, "ExtendSupport");
extendSupportAction.Parameter<DateTime>("newSupportedUntilDate");
extendSupportAction.ReturnsFromEntitySet<ProductFamily>("ProductFamilies");

NOTE: I am returning ProductFamily entity record as return type

My method in controller:
public ProductFamily ExtendSupport(int parentId, ODataActionParameters actionParams)

Result:
Error during formatter write. The exception is "Object does not match target type."

NOTE:
This scenario works fine if i create a BINDABLE action configuration with the same parameter and return type mentioned above. The return type value shouldn't depend on the bindability of the paramater.

My Request:
POST http://kirandesktop:50231/Products(49)/ExtendSupport HTTP/1.1
User-Agent: Fiddler
Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose
Host: kirandesktop:50231
Content-Length: 47

{"newSupportedUntilDate":"2021-12-31T00:00:00"}
Comments: Sure..got it. Was thinking that non-bindable actions could be anywhere in the uri space(provided appropriate route is present though) as these are not bound by any context (like the parentId). Regarding the 'parentId' in the bug, yeah, that was a mistake.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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