C#C
C#4y ago
malkav

Creating an Array of strings from a stringified JSON

So I have this kind of JSON structure:
{
  "sourceJson": [
    {
      "BookID": "1",
      "BookTitle": "SQL World",
      "BookPrice": "550"
    },
    // ...
  ],
  "targetJson": [
    {
      "BookID": "6",
      "BookTitle": "High Availability",
      "BookPrice": "900"
    }
  ]
}

and I want to use Newtonsoft.Json to DeserializeObject<string[]>(sourceJson) but when I do this, I get "Unexpected character '{' at path: sourceJson line 3 position 5"

Does anyone know how to convert this json into a string[] or IEnumerable<string>?
Perhaps I have to use JArray instead?? I don't know
Was this page helpful?