I have the following controller action:
[HttpGet]
public JsonpResult getTestValues(int? entityId, int? id)
{
return JsonpResult(WebResult.Success());
}
I have a AJAX call that invokes this controller and has to parse the data object returned. How can I modify the above to return the following?
{"data":[{"T1":"t1@test.com","T11":"1234-1234-1234-1234"},
{"T2":"t2@test.com","T22":"1234-1234-1234-1234"}]}
I need this for testing the UI framework that I am working on. Any suggestions on how to return the above hardcoded data?
Yes, you can do this using an anonymous type: