After almost 3 days trying to implement I was not successful. I have the following json:
{ "code": 200,
"data": [
{ "id": 1, "type": "charge", "custom_id": "1208", "status": { "current": "new", "previous": null }, "identifiers": { "charge_id": 542814 }, "created_at": "2018-12-03 11:15:24" },
{ "id": 2, "type": "charge", "custom_id": "1208", "status": { "current": "waiting", "previous": "new" }, "identifiers": { "charge_id": 542814 }, "created_at": "2018-12-03 11:15:28" } ] }
My goal is to get the "status" item. The following code works fine:
dynamic stuff1 = Newtonsoft.Json.JsonConvert.DeserializeObject(jo);
string Text = stuff1.data.status.current;
The code works to get the item from the first line, but how do I get the status attribute always from the last line , because it will always grow. I tried using .ToLast () to get the last record of "current" but I'm not succeeding.