Hi I'm working on Json Deserialize Object on C# using json newton. Below is my code.
transactions = JsonConvert.DeserializeObject<List<TransactionClass>>(response.Content);
And returned results.
[
{
"id":1,
"school_uuid":"d17eab20-a442-11e9-928b-cb6a3dc8f7ea",
"student_id":1,
"actiontype":"1",
"total":100,
"created_at":"2019-07-12 01:54:45",
"updated_at":"2019-07-12 01:54:45"
},
{
"id":2,
"school_uuid":"d17eab20-a442-11e9-928b-cb6a3dc8f7ea",
"student_id":1,
"actiontype":"1",
"total":100,
"created_at":"2019-07-12 01:55:28",
"updated_at":"2019-07-12 01:55:28"
}
]
I would like to sum for item total
, In this case sum = 100 + 100 = 200
. It work fine on looping method. But I prefer shorter like linq instead. Any advice or guidance on this would be greatly appreciated, Thanks.