C#C
C#2y ago
Anarchist

Deserialise part of a json response

Hello, how could I use newtonsoft to deserialise part of a large json response into a smaller set of objects? e.g. if the response is...
{
  "count": 100,
  "next": "https://api",
  "previous": null,
  "results": [
    {
      "name": "a",
      "id": 1,
      "extra": "whatever"
    },
     {
      "name": "b",
      "id": 2,
      "extra": "whatever"
    },
  ]
}

...how would I extract just an array of the elements in result, with only some params, e.g. [ { "a", 1 }, { "b" , 2 } ]
Was this page helpful?