Edward van Nijmweegen
asked on
How to create an array in a JSON query with C#
Hello all,
This request is refering to an existing request, which works great, but i have one small addition. In the above solution, there is only one option, but now i have more like:
In the above solution one option is made with the following code:
My question is, how can i make the orther(s). When i try this i get an error that my array is not correct. I tried something like:
But this didn't work.
Thanks in advance.
Edward
This request is refering to an existing request, which works great, but i have one small addition. In the above solution, there is only one option, but now i have more like:
"options": [
{
"key": "DOOR"
},
{
"key": "REFERENCE",
"input": "TEST JEROEN"
}
],
In the above solution one option is made with the following code:
options = new[] { new { key = "DOOR" } },
My question is, how can i make the orther(s). When i try this i get an error that my array is not correct. I tried something like:
options = new object[] {
new { key = "DOOR" },
new { key = "REFERENCE"},
new {input = dhlLabelRequest.orderReference.ToString() }
But this didn't work.
Thanks in advance.
Edward
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad it worked out for you.
-saige-
-saige-
ASKER
Again thank you a lot. It is working as it should work.
Even with your comment at the end it does do the job.
Thanks,
Edward