I have a Json array string:
data = "[[2, 3, 32],[6,19,7],[17,19,10]]";
I would like it to serialize it by Newtonsoft json. So I made a class:
public class Root
{
public List<List<int>> MyArray { get; set; }
}
But this code is giving me an error:
List<Root> deserialize = JsonConvert.DeserializeObject<List<Root>>(e.data);
Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Root' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly. To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array.
What Im doing wrong?