There is a JSON array like below
[{ "name" : "XX", "age" : 20}, { "company" : "YY", "post" : "XXX"} , ...]
I want to deserialize it into object[]
, but I wanna control the actual type of the element in the array to be instance of specificed classes
class A{
public string name;
public int age;
}
class B{
public string company;
public string post;
}
So that I can get the object by (A)array[0]
or (B)array(1)
Thx