Reputation: 606
Attempting to setup an action in my odata WebAPI controller, that accepts a List of objects.
however, when I try:
updateSortOrder.Parameter<List<UpdateItem>>("SortOrder");
and pass in
{"SortOrder": [{"ItemProperty":"test"}]}
my ODataActionParameters is null.
It works if I change the parameters to accept a single UpdateItem rather than a list, and use:
{"SortOrder": {"ItemProperty":"test"}}
or if I create a wrapper class that contains a list of UpdateItems, but I have been unable to set the parameter itself to a list.
Upvotes: 1
Views: 1486
Reputation: 6793
Use,
updateSortOrder.CollectionParameter<UpdateItem>("SortOrder");
instead.
Upvotes: 4