I'm very new to asp net, I'm trying to return an array like this:
[
{Option: 'Yes', Total: 10},
{Option: 'No', Total: 8}
]
I have these two objects:
var op1 = new
{
Option = "Yes",
Total = 10
};
var op2 = new
{
Option = "No",
Total = 8
};
var ret = ???
return Json(ret, JsonRequestBehavior.AllowGet);
How can I do this?
Totalactually are something likectx.Table.Where(x => x.Item > Number).Count()