I'm trying to read values from System.Web.Helpers.DynamicJsonObject. I can see the values in the debugger but I can't figure out how to access them. I have tried this
item.GetType().GetProperty("batch_id").GetValue(item, null);
but when I try that I get this response in the debugger "item.GetType().GetProperty("batch_id")' is null"
I have attached a picture from my solution
Thank you, -Tesh
It is dynamic so you can just do:
string batchId = item.batch_id;
If for some reason you have the property name in a string
, and don't know it at compile time, the indexing operator will work:
string value = item["batch_id"];