久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='eZLDM'><tr id='eZLDM'><dt id='eZLDM'><q id='eZLDM'><span id='eZLDM'><b id='eZLDM'><form id='eZLDM'><ins id='eZLDM'></ins><ul id='eZLDM'></ul><sub id='eZLDM'></sub></form><legend id='eZLDM'></legend><bdo id='eZLDM'><pre id='eZLDM'><center id='eZLDM'></center></pre></bdo></b><th id='eZLDM'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='eZLDM'><tfoot id='eZLDM'></tfoot><dl id='eZLDM'><fieldset id='eZLDM'></fieldset></dl></div>
    1. <tfoot id='eZLDM'></tfoot>
    2. <legend id='eZLDM'><style id='eZLDM'><dir id='eZLDM'><q id='eZLDM'></q></dir></style></legend>

          <bdo id='eZLDM'></bdo><ul id='eZLDM'></ul>
      1. <small id='eZLDM'></small><noframes id='eZLDM'>

        無法將 JSON 數(shù)組(例如 [1,2,3])反序列化為類型“

        Cannot deserialize the JSON array (e.g. [1,2,3]) into type #39; #39; because type requires JSON object (e.g. {quot;namequot;:quot;valuequot;}) to deserialize correctly(無法將 JSON 數(shù)組(例如 [1,2,3])反序列化為類型“,因?yàn)轭愋?
        <tfoot id='rGCgz'></tfoot>
          <tbody id='rGCgz'></tbody>
          <bdo id='rGCgz'></bdo><ul id='rGCgz'></ul>
              <i id='rGCgz'><tr id='rGCgz'><dt id='rGCgz'><q id='rGCgz'><span id='rGCgz'><b id='rGCgz'><form id='rGCgz'><ins id='rGCgz'></ins><ul id='rGCgz'></ul><sub id='rGCgz'></sub></form><legend id='rGCgz'></legend><bdo id='rGCgz'><pre id='rGCgz'><center id='rGCgz'></center></pre></bdo></b><th id='rGCgz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rGCgz'><tfoot id='rGCgz'></tfoot><dl id='rGCgz'><fieldset id='rGCgz'></fieldset></dl></div>

            1. <small id='rGCgz'></small><noframes id='rGCgz'>

              <legend id='rGCgz'><style id='rGCgz'><dir id='rGCgz'><q id='rGCgz'></q></dir></style></legend>

                  本文介紹了無法將 JSON 數(shù)組(例如 [1,2,3])反序列化為類型“",因?yàn)轭愋托枰?JSON 對(duì)象(例如 {“name":“value"})才能正確反序列化的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有這個(gè) JSON:

                  [
                      {
                          "Attributes": [
                              {
                                  "Key": "Name",
                                  "Value": {
                                      "Value": "Acc 1",
                                      "Values": [
                                          "Acc 1"
                                      ]
                                  }
                              },
                              {
                                  "Key": "Id",
                                  "Value": {
                                      "Value": "1",
                                      "Values": [
                                          "1"
                                      ]
                                  }
                              }
                          ],
                          "Name": "account",
                          "Id": "1"
                      },
                      {
                          "Attributes": [
                              {
                                  "Key": "Name",
                                  "Value": {
                                      "Value": "Acc 2",
                                      "Values": [
                                          "Acc 2"
                                      ]
                                  }
                              },
                              {
                                  "Key": "Id",
                                  "Value": {
                                      "Value": "2",
                                      "Values": [
                                          "2"
                                      ]
                                  }
                              }
                          ],
                          "Name": "account",
                          "Id": "2"
                      },
                      {
                          "Attributes": [
                              {
                                  "Key": "Name",
                                  "Value": {
                                      "Value": "Acc 3",
                                      "Values": [
                                          "Acc 3"
                                      ]
                                  }
                              },
                              {
                                  "Key": "Id",
                                  "Value": {
                                      "Value": "3",
                                      "Values": [
                                          "3"
                                      ]
                                  }
                              }
                          ],
                          "Name": "account",
                          "Id": "2"
                      }
                  ]
                  

                  我有這些課程:

                  public class RetrieveMultipleResponse
                  {
                      public List<Attribute> Attributes { get; set; }
                      public string Name { get; set; }
                      public string Id { get; set; }
                  }
                  
                  public class Value
                  {
                      [JsonProperty("Value")]
                      public string value { get; set; }
                      public List<string> Values { get; set; }
                  }
                  
                  public class Attribute
                  {
                      public string Key { get; set; }
                      public Value Value { get; set; }
                  }
                  

                  我正在嘗試使用以下代碼反序列化上述 JSON:

                  I am trying to deserialize the above JSON using the code below:

                  var objResponse1 = JsonConvert.DeserializeObject<RetrieveMultipleResponse>(JsonStr);
                  

                  但我收到此錯(cuò)誤:

                  無法將當(dāng)前 JSON 數(shù)組(例如 [1,2,3])反序列化為類型'test.Model.RetrieveMultipleResponse' 因?yàn)樵擃愋托枰?JSON對(duì)象(例如 {"name":"value"})正確反序列化.要解決這個(gè)問題錯(cuò)誤要么將 JSON 更改為 JSON 對(duì)象(例如 {"name":"value"})或?qū)⒎葱蛄谢愋透臑閿?shù)組或?qū)崿F(xiàn)的類型一個(gè)集合接口(例如 ICollection、IList),比如 List 可以從 JSON 數(shù)組反序列化.JsonArrayAttribute 也可以添加到類型以強(qiáng)制它從 JSON 數(shù)組反序列化.小路'',第 1 行,位置 1.

                  Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'test.Model.RetrieveMultipleResponse' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly. To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array. Path '', line 1, position 1.

                  推薦答案

                  您的 json 字符串包含在方括號(hào) ([]) 中,因此它被解釋為數(shù)組而不是單個(gè) RetrieveMultipleResponse 對(duì)象.因此,您需要將其反序列化為 RetrieveMultipleResponse 的類型集合,例如:

                  Your json string is wrapped within square brackets ([]), hence it is interpreted as array instead of single RetrieveMultipleResponse object. Therefore, you need to deserialize it to type collection of RetrieveMultipleResponse, for example :

                  var objResponse1 = 
                      JsonConvert.DeserializeObject<List<RetrieveMultipleResponse>>(JsonStr);
                  

                  這篇關(guān)于無法將 JSON 數(shù)組(例如 [1,2,3])反序列化為類型“",因?yàn)轭愋托枰?JSON 對(duì)象(例如 {“name":“value"})才能正確反序列化的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時(shí)忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標(biāo)簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯(cuò)誤的 XML)

                      <bdo id='r7GPF'></bdo><ul id='r7GPF'></ul>
                        <i id='r7GPF'><tr id='r7GPF'><dt id='r7GPF'><q id='r7GPF'><span id='r7GPF'><b id='r7GPF'><form id='r7GPF'><ins id='r7GPF'></ins><ul id='r7GPF'></ul><sub id='r7GPF'></sub></form><legend id='r7GPF'></legend><bdo id='r7GPF'><pre id='r7GPF'><center id='r7GPF'></center></pre></bdo></b><th id='r7GPF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='r7GPF'><tfoot id='r7GPF'></tfoot><dl id='r7GPF'><fieldset id='r7GPF'></fieldset></dl></div>

                      • <tfoot id='r7GPF'></tfoot>
                            <tbody id='r7GPF'></tbody>

                          <small id='r7GPF'></small><noframes id='r7GPF'>

                        1. <legend id='r7GPF'><style id='r7GPF'><dir id='r7GPF'><q id='r7GPF'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 亚洲精品免费视频 | 日韩在线一区二区三区 | 少妇精品久久久久久久久久 | 国产精品久久久久久久久久久久久 | 成人精品一区二区三区中文字幕 | 黄色免费看 | 国产精品2 | 久久小视频 | 人人天天操 | 久久精品国产免费 | 国产欧美精品一区二区 | 日韩在线观看一区 | 国产美女高潮 | 亚洲xx在线 | 99精品视频在线 | 亚洲精品一区在线观看 | 久久国产精品99久久久大便 | 日本视频中文字幕 | 天天精品在线 | 国产一级视屏 | 久久婷婷av| 亚洲一区二区三区免费观看 | 免费成人午夜 | 少妇久久久 | 亚洲精品视频三区 | 精精国产xxxx视频在线播放 | 日日淫 | h小视频 | 亚洲一区二区三区视频 | 亚洲自拍偷拍免费视频 | 亚洲精视频 | 亚洲一区二区中文字幕 | 蜜月va乱码一区二区三区 | 美人の美乳で授乳プレイ | 日韩精品久久久久久 | 国产探花在线精品一区二区 | 日本午夜精品一区二区三区 | 日本不卡在线观看 | 国产精品一区二区av | 日韩精品免费视频 | 在线中文字幕视频 |