public JsonResult GetPayments()
{
var paymentTypes = PaymentRepository.GetAll();
var jsonData = new { rows = paymentTypes.Select(q => new { Id = q.Id.ToString(), q.Name }).ToList() };
return Json(jsonData, JsonRequestBehavior.AllowGet);
}
It basically returns the Id
and Name
of the Payments
as Json data.
I was wanting to test this so I was wanting to test that each row of data generated had the right information in it.
However the JsonResult
returned I can do:
JsonResult.Data
I can't seem to get to the individual rows. Any suggestions?