You are developing an ASP.NET Web API action method.
The action method must return the following JSON inthe message body.
{“Name”:”Fabrikam”, “Vendor Id”: 9823, “Items”: [“Apples”, “Oranges”]}
You need to return an anonymous object that is serialized to JSON.
What should you do?
Leave a Reply
first box=return new
second box=”Fabrikam”, VendorNumber=9823
third box=new List{“Apples”,”Oranges”}
But in some dumps it is written like “9823”.Any comments on this.
“9823” is incorrect. See http://stackoverflow.com/questions/15368231/can-json-numbers-be-quoted