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

Commented 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: If it is Not bindable why is there a parameter parentId parameter in the Action? NonBindable accounts are only available on the root of the service. i.e. /server/service/Action Now you probably need to create a ROUTE that look finds this action, but that should be trivial?

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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