Josn 不同模型在同一List里如何实现
C#没办法表现下面的数据是吗?
{
"modules": [{
"Links": [{
"LinkID": "0",
"LinkType": "",
"LinkDesc": "",
"Text": "链接文字",
"Image": "\/comdata\/12314389\/201804\/2018041011412439b55e.jpg",
"LinkKey": "15238771131"
}],
"PaddingLR": 0,
"HeightPercent": 53,
"ShowType": 0,
"ModuleType": "ModuleSlide",
"Layout": 101,
"LayoutColor": "",
"ModuleID": 91042,
"Publish": 1,
"CanDesign": true,
"CanEditFront": true
}, {
"Type": 1,
"Width": 10,
"Color": "#f4f4f3",
"PaddingLR": 0,
"PaddingTB": 0,
"ModuleType": "ModuleLine",
"Layout": 101,
"LayoutColor": "",
"ModuleID": 91044,
"Publish": 1,
"CanDesign": true,
"CanEditFront": true
}]
}
用Json.NET反序列化为dynamic
试试
对,我后来就是这么用的,谢谢,看来我的基础还好多没理解
可以的,大不了你把List声明为object好了。
嗯,明白,谢谢
吐槽下,标题Json写成了Josn了😀
Json