1

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.

1 Answer 1

4

Use,

updateSortOrder.CollectionParameter<UpdateItem>("SortOrder"); 

instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.