c# - Json数据检索
问题描述
我已经尝试了一些方法来从 json 数组中获取我的产品详细信息。任何人都可以帮助我在 c# 中做,只是我在下面添加了我的 api 响应。从该响应中,我需要提取产品详细信息以列出。提前致谢。
API响应:{“状态”:“成功”,“结果”:[{“订单ID”:“SG20011000007”,“订单数量”:“2970”,“交付API状态”:“计划”,“oid”:“20011”, “买家”:“客人”,“shipping_address”:“{”gt_data”:“2970”,“grand1”:“2970”,“firstname”:“MANIMARAN S”,“lastname”:null,“address1”:” 408868芽笼","address2":"BBBB","zip":"408868","电话":"123","email":"svenkatesh.unipro@gmail.com","floor_no":"123", "unit_no":"123","country":"Singapore","state":null,"cities":null,"short_country":"SG"}", "vat": null, "tax_method": "default", "vat_percent": "", "shipping": "0", "payment_type": "cash_on_delivery", " payment_status": "[{"admin":"","status":"paid"}]", "discount": null, "sale_datetime": "1613360073", "delivery_status": "[{"admin":" ","status":"delivered","delivery_time":""}]", "created_datetime": "2021-02-15 09:04:33", "order_type": "shopping", "type": "交货”,“product_details”:[“{“8d7c30cf7b10b49f854c2a295a5c9413”:{“id”:”24465","qty":1,"option":"{\"color\":{\"title\":\"Color\",\"value\":null}}","price":1485 ,"name":"耳机","discount_type":"","after_coupon":0,"shipping":null,"tax":null,"image":"http:\/\/storesmartstore.com\/ uni-inclusive\/uploads\/product_image\/product_24465_1_thumb.jpg","coupon":"","rowid":"8d7c30cf7b10b49f854c2a295a5c9413","subtotal":1485,"tax_percent":"0","tax_type":"百分比","tax_method":"default"}}", "{"0608bbe8fc09e0880e7d866d513c7c53":{"id":"24466","qty":1,"option":"{\"color\":{\"title\":\"Color\",\"value\":null}}","price":1485,"name":"Mobile","discount_type":"","after_coupon":0,"shipping ":null,"tax":null,"image":"http:\/\/storesmartstore.com\/uni-inclusive\/uploads\/product_image\/product_24466_1_thumb.jpg","coupon":""," rowid":"0608bbe8fc09e0880e7d866d513c7c53","subtotal":1485,"tax_percent":"0","tax_type":"percent","tax_method":"default"}}" ] } ] }"图片":"http:\/\/storesmartstore.com\/uni-inclusive\/uploads\/product_image\/product_24466_1_thumb.jpg","优惠券":"","rowid":"0608bbe8fc09e0880e7d866d513c7c53","小计" :1485,"tax_percent":"0","tax_type":"percent","tax_method":"default"}}" ] } ] }"图片":"http:\/\/storesmartstore.com\/uni-inclusive\/uploads\/product_image\/product_24466_1_thumb.jpg","优惠券":"","rowid":"0608bbe8fc09e0880e7d866d513c7c53","小计" :1485,"tax_percent":"0","tax_type":"percent","tax_method":"default"}}" ] } ] }
解决方案
推荐阅读
- php - 带有子选择的 Doctrine 查询构建器内部联接
- symfony4 - 在 API 平台中保存相关对象
- asp.net-core - .NET Core 操作筛选器不是属性类
- c# - 有没有办法快速检查,字符串与正则表达式匹配的百分比是多少?
- laravel - Laravel google oauth 2回调返回403禁止
- solver - SimCity (BuildIt) 经济的子集可以用 Minizinc 表示吗?
- python - 机器人框架:使用关闭所有浏览器时套件拆解失败
- docker - 如何在没有 pip 的 docker 映像中安装 AWS CLI 工具?
- python - 将日期框架中列的值与熊猫中其他数据框架的列值进行比较
- r - 如何遍历数据框并计算不同字符串的出现次数并将其计数添加到其他列