0

I'm trying to pass an Json array to a web api and get all that values to a single array or a list in the web api.

to test this I'm using Postman app in Google. This is my input data

[{
"ID":"1",
"ID":"2",
"ID":"3"
}]

What I want is to pass these data to a post method and get all these data into a single array or a list. How can I do this?

I need to execute the following query

Select * from table where ID in ("I need the data list here");

To do that I have to get all the data sent to from the json to a single array or a list.

3
  • Hi, sadly this isn't enough to come here and ask a question. You should prove that you've already put some effort before coming here... AFAIK, a 10 seconds query on Google should be enough to see how parameter binding works on WebAPI... Commented May 27, 2016 at 5:29
  • I did a bit of editing in the original question. I'm not sure whether parameter binding is the solution for my requirement Commented May 27, 2016 at 5:34
  • The solution is always parameter binding. Sometimes you use built-in parameter binders and other times you need to implemetn your custom ones. In your case, built-in ones are enough ;) Commented May 27, 2016 at 11:14

1 Answer 1

2

{} = json object. [] = json array. you are passing a json array with one object in it

[
{"ID":"1"},
{"ID":"2"},
{"ID":"3"}
]
Sign up to request clarification or add additional context in comments.

1 Comment

OMG. This was the Problem. You are the best. Thank you so much man You saved my day

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.