Как десериализовать коллекцию json.
Как десериализовать коллекцию json.
{"success":true,"data":{"game_id":1,"game_name":"Test Game","game_owner_id":1,"host_id":1,"host_name":"Test Host","variant_id":1,"variant_name":"DeskTop","mode":"demoplay","host_game_id":1,"host_game_display_name":"Test Host Game","host_interface_id":1,"host_interface_name":"Test Interface Name","parameters":{"host_parameters":[{"parameter_id":1,"parameter_name":"Test Base Parameter","parameter_value":"Host param value","currency_code":"INR"}],"game_parameters":[{"parameter_id":1,"parameter_name":"Test Base Parameter","parameter_value":"Game param value","currency_code":"INR"},{"parameter_id":2,"parameter_name":"Test Base Parameter","parameter_value":"ffffsss","currency_code":"INR"}]},"game":"Test Game","host":"Test Host","variant":"DeskTop"},"message":"Games retrieved successfully"}
Что я уже пробовал:
dynamic stuff = JsonConvert.DeserializeObject(jsondata); string str = stuff.success + "<br>" + stuff.data.game_id + "<br>" + stuff.data.game_name + "<br>" + stuff.data.variant_name + "<br>" + stuff.message + "<br>" + stuff.data.game_owner_id + "<br>" + stuff.data.host_id + "<br>" + stuff.data.host_name + "<br>" + stuff.data.variant_id + "<br>" + stuff.data.variant_name + "<br>" + stuff.data.mode + "<br>" + stuff.data.host_game_id + "<br>" + stuff.data.host_game_display_name + "<br>" + stuff.data.host_interface_id + "<br>" + stuff.data.host_interface_name ; Response.Write(str); but i am stuck when i try to get data from "parameters":{"host_parameters":[{"parameter_id":1,"parameter_name":"Test Base Parameter","parameter_value":"Host param value","currency_code":"INR"}] this section.