{ "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 } ] } ] } }}
如果需要拿來(lái)用,肯定要反序列化,序列化成實(shí)體,結(jié)構(gòu)如下(一般情況下你會(huì)手寫(xiě)的,大神除外):
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; } }
寫(xiě)完這些你是不是覺(jué)得自己蒙蒙噠??
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; } }
它里面可能和自己定義的有點(diǎn)不一樣,那對(duì)象數(shù)組和泛型list有什么區(qū)別呢?
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注