My function returns JsonResult:
var obj = new { pc = peopleCount, fp = finalPrice, os = osoba, dt = date, zd = zadatek };
return new JsonResult { Data = obj, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
and I'd like to get all values from JsonResult. It's simple if there is only one value, but here I have an object with 5 properies. How to get them? For now I have:
var getPrice = (JsonResult)GetBundleData(item.EventID);
var price = getPrice.Data;
and I can see that in price
there are those values
but I can't get them by just using dot and property name. There are only Equals()
, GetHashCode()
, GetType()
and ToString()
.