I have a JSON string like following string
{
FlightId : 1,
[
{
AirplaneId : 1
},
{
AirplaneId : 2
}
]
}
I have defined 2 classes to convert this JSON string to the objects of these 2 classes :
class Airplane
{
int AirplaneId;
}
class Flight
{
int FlightId;
List<Airplane> Airplanes;
}
During convert the string to these classes objects I get an error. The error tells me that JSON string is not recognized and I should define a name for the list in my JSON string. I can not change the JSON string , how to define my class to convert this JSON String