Currently I am trying to deserialize a json string to a list of objects. I have this json string:
{
"begin_date": "2016-02-01",
"end_date": "2016-02-11",
"query_type": "ap",
"sorties": [
{
"id": "icao:440044",
"cs": "GEZC",
"launch": "",
"tow_id": "",
"tow_name": "",
"type": 15,
"date": "2016-02-03",
"tkof": {
"time": "",
"loc": "EHTL",
"rwy": ""
},
"ldg": {
"time": "23:16",
"loc": "EHTL",
"rwy": "2"
},
"dalt": "20",
"dt": ""
},
{
"id": "icao:440044",
"cs": "GEZC",
"launch": "S",
"tow_id": "",
"tow_name": "",
"type": 15,
"date": "2016-02-03",
"tkof": {
"time": "23:17",
"loc": "EHTL",
"rwy": "0"
},
"ldg": {
"time": "",
"loc": "EHTL",
"rwy": ""
},
"dalt": "10",
"dt": ""
},
{
"id": "icao:440044",
"cs": "GEZC",
"launch": "S",
"tow_id": "",
"tow_name": "",
"type": 15,
"date": "2016-02-04",
"tkof": {
"time": "14:54",
"loc": "EHTL",
"rwy": "32"
},
"ldg": {
"time": "",
"loc": "EHTL",
"rwy": ""
},
"dalt": "250",
"dt": ""
},
{
"id": "icao:440044",
"cs": "GEZC",
"launch": "",
"tow_id": "",
"tow_name": "",
"type": 15,
"date": "2016-02-04",
"tkof": {
"time": "",
"loc": "EHTL",
"rwy": ""
},
"ldg": {
"time": "23:12",
"loc": "EHTL",
"rwy": "19"
},
"dalt": "10",
"dt": ""
},
{
"id": "icao:440044",
"cs": "GEZC",
"launch": "S",
"tow_id": "",
"tow_name": "",
"type": 15,
"date": "2016-02-05",
"tkof": {
"time": "13:05",
"loc": "EHTL",
"rwy": "32"
},
"ldg": {
"time": "",
"loc": "EHTL",
"rwy": ""
},
"dalt": "0",
"dt": ""
},
{
"id": "icao:440044",
"cs": "GEZC",
"launch": "",
"tow_id": "",
"tow_name": "",
"type": 15,
"date": "2016-02-05",
"tkof": {
"time": "",
"loc": "EHTL",
"rwy": ""
},
"ldg": {
"time": "13:19",
"loc": "EHTL",
"rwy": "14"
},
"dalt": "0",
"dt": ""
},
{
"id": "icao:440044",
"cs": "GEZC",
"launch": "S",
"tow_id": "",
"tow_name": "",
"type": 15,
"date": "2016-02-05",
"tkof": {
"time": "19:59",
"loc": "EHTL",
"rwy": "23"
},
"ldg": {
"time": "",
"loc": "EHTL",
"rwy": ""
},
"dalt": "0",
"dt": ""
}
],
"sum_dt": "0",
"first_tkof": "23:17",
"last_ldg": "13:19",
"max_dalt": 250
}
I want to store all the sorties into a list of objects that i've created. So I can easily work with it. I know I could use Newtonsoft.Json.JsonConvert.DeserializeObject but I only know how to do it on non nested json strings.
public class Flight
{
public string id { get; set; }
public string cs { get; set; }
public string launch { get; set; }
public string tow_id { get; set; }
public string tow_name { get; set; }
public int type { get; set; }
public string date { get; set; }
public string tkof { get; set; }
public string ldg { get; set; }
public string dalt { get; set; }
public string dt { get; set; }
}

tkof,ldganddaltare?