I am trying to create an array from a .json array and get only 2 variables in the array (keyName and token) out of the whole current .json array.
The .json that is being received by an api call:
{
"project": [
{
"id": 1,
"keyName": "John123",
"age": "19",
"token": "123456789"
},
{
"id": 2,
"keyName": "Mary123",
"age": "13",
"token": "23435"
},
{
"id": 3,
"keyName": "Harry123",
"age": "23",
"token": "2343542"
}
]
}
I only want an array that has the keyName and token being shown for each object, how can I do this?
At the moment I have used an api call to get the .json file then I have parsed it into an array as shown below:
Projects = JArray.Parse(resp.Content);
Please help as I am new to C#, sorry if some doesn't make sense my english isnt very good.