Now I have this class
public class FooResult
{
public int sEcho;
public Foo[] aaData;
internal FooResult()
{
sEcho = 1;
aaData = new FooRepository().GetAll().ToArray();
}
}
new FooRepository().GetAll().ToArray(); returns an array of Foos.
When I use System.Web.Mvc.Controller.Json to convert this FooResult into a JsonResult, I got the string in Json Format like this:
{"sEcho":3, "aaData":[{"Name":"BarName"},{"Name":"FooName"}]}
However, I want the aaData to be a two dimensional array instead of an array of objects, which means it should be in this format:
{"sEcho":3, "aaData":[["BarName"],["FooName"]]}
How can I do that?
["key":"value"]. You can have `["key","value"] is you want.