{ "items_custom_get_response": { "items": { "item": [ { "num_iid": 1, "PRoduct_id": 0, "skus": [ { "created": null, "modified": null, "outer_id": null, "price": null, "properties": null, "properties_name": "黑色", "quantity": "2", "sku_id": null } ] } ] } }}
如果需要拿来用,肯定要反序列化,序列化成实体,结构如下(一般情况下你会手写的,大神除外):
public class Rootobject { public Items_Custom_Get_Response items_custom_get_response { get; set; } } public class Items_Custom_Get_Response { public Items items { get; set; } } public class Items { public List<Item> item { get; set; } } public class Item { public int num_iid { get; set; } public int product_id { get; set; } public List<Sku> skus { get; set; } } public class Sku { public object created { get; set; } public object modified { get; set; } public object outer_id { get; set; } public object price { get; set; } public object properties { get; set; } public string properties_name { get; set; } public string quantity { get; set; } public object sku_id { get; set; } }
写完这些你是不是觉得自己蒙蒙哒??
public class Rootobject { public Items_Custom_Get_Response items_custom_get_response { get; set; } } public class Items_Custom_Get_Response { public Items items { get; set; } } public class Items { public Item[] item { get; set; } } public class Item { public int num_iid { get; set; } public int product_id { get; set; } public Sku[] skus { get; set; } } public class Sku { public object created { get; set; } public object modified { get; set; } public object outer_id { get; set; } public object price { get; set; } public object properties { get; set; } public string properties_name { get; set; } public string quantity { get; set; } public object sku_id { get; set; } }
它里面可能和自己定义的有点不一样,那对象数组和泛型list有什么区别呢?
新闻热点
疑难解答