C#反序列化Json对象,Id被视为类型

时间:2018-05-03 18:04:35

标签: c# json

我有这个简化的JSON对象数组被返回,但问题是ID(13294和13350)被视为一种类型,并且无法取消地址。

以下是我正在使用的内容:

JsonConvert.DeserializeObject<List<JsonResultCustom>>(rawjson);

public class JsonResultCustom
{
    public string blurb { get; set; }
    public SplashImage splash_image { get; set; }
    public string title { get; set; }
    public string permalink { get; set; }
}

JSON:

{
   "13294": {
    "blurb": "Proin tellus enim, mollis id facilisis",
    "splash_image": {//CUSTOM OBJECT},
    "title": "MPC EXAMPLE with Video",
    "permalink": "https://www.test.com/"
   },
   "13350": {
     "blurb": "Soufflé cotton candy",
     "splash_image": {//CUSTOM OBJECT},
     "title": "MPC SAMPLE: Berry",
     "permalink": "https://www.test.com/blog/"
   }
 }

0 个答案:

没有答案