Update Based on change in OP
As per your latest edit in the question, you have an array of MyArray
. You should hence deserialize using a collection of MyArray.
For example,
var myDeserializedClass1 = JsonConvert.DeserializeObject<MyArray[]>(rawJson);
// OR
var myDeserializedClass1 = JsonConvert.DeserializeObject<IEnumerable<MyArray>>(rawJson);
Based on Original Question before the Edit
You are attempting to deserialize using wrong object type (Root
), which is why it fails to do so, and returns a null value.
Your Json contains a single instance of MyArray
and not an instance of Root
. You need to deserialize using
var myDeserializedClass1 = JsonConvert.DeserializeObject<MyArray>(rawJson);
That would provide you the desired result.
CLICK HERE to find out more related problems solutions.