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

  • <legend id='vHxjY'><style id='vHxjY'><dir id='vHxjY'><q id='vHxjY'></q></dir></style></legend>
    1. <tfoot id='vHxjY'></tfoot>
    2. <small id='vHxjY'></small><noframes id='vHxjY'>

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

        Json.Net PopulateObject 追加列表而不是設置值

        Json.Net PopulateObject Appending list rather than setting value(Json.Net PopulateObject 追加列表而不是設置值)
        <i id='7Jcdz'><tr id='7Jcdz'><dt id='7Jcdz'><q id='7Jcdz'><span id='7Jcdz'><b id='7Jcdz'><form id='7Jcdz'><ins id='7Jcdz'></ins><ul id='7Jcdz'></ul><sub id='7Jcdz'></sub></form><legend id='7Jcdz'></legend><bdo id='7Jcdz'><pre id='7Jcdz'><center id='7Jcdz'></center></pre></bdo></b><th id='7Jcdz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7Jcdz'><tfoot id='7Jcdz'></tfoot><dl id='7Jcdz'><fieldset id='7Jcdz'></fieldset></dl></div>
      1. <tfoot id='7Jcdz'></tfoot>

        • <legend id='7Jcdz'><style id='7Jcdz'><dir id='7Jcdz'><q id='7Jcdz'></q></dir></style></legend>
              <tbody id='7Jcdz'></tbody>
              <bdo id='7Jcdz'></bdo><ul id='7Jcdz'></ul>

                <small id='7Jcdz'></small><noframes id='7Jcdz'>

                  本文介紹了Json.Net PopulateObject 追加列表而不是設置值的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在 .Net 4.5 中使用 Json.Net,當在以下對象上使用填充對象時,它會使用 json 的內容來增加 List 的值,而不是設置它的值.

                  I am using Json.Net for .Net 4.5 and when using populate object on the following object it increments the List's with the content of the json rather than setting its value.

                  Json.Net

                  JsonConvert.PopulateObject(string, object)
                  

                  class MySettingSubClass
                  {
                      public List<string> MyStringList1 = new List<string>(){"one", "two", "three"}
                  }
                  
                  class MySetting
                  {
                      public string MyString = "MyString";
                      public int MyInt = 5;
                      public MySettingSubClass MyClassObject = new MySettingSubClass();
                      public List<string> MyStringList2 = new List<string>{"one", "two", "three"};
                  }
                  

                  當它們最初加載時,一切都是正確的,但是從 JSON 重新加載兩個 MyStringLists 都是重復的 one"、two"、three"、one"、two"、three"

                  When they initially load, all is correct, however reloading from JSON both MyStringLists are duplicated "one", "two", "three", "one", "two", "three"

                  推薦答案

                  你應該告訴 Json.Net 替換數組,像這樣:

                  You should tell Json.Net to replace the arrays, like this:

                  var serializerSettings = new JsonSerializerSettings {ObjectCreationHandling = ObjectCreationHandling.Replace};
                  
                  
                  JsonConvert.PopulateObject(jasonString, myObject, serializerSettings)
                  

                  這篇關于Json.Net PopulateObject 追加列表而不是設置值的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

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

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

                    • <bdo id='bD2Ln'></bdo><ul id='bD2Ln'></ul>

                            <tbody id='bD2Ln'></tbody>
                          <legend id='bD2Ln'><style id='bD2Ln'><dir id='bD2Ln'><q id='bD2Ln'></q></dir></style></legend>
                          • <tfoot id='bD2Ln'></tfoot>
                            <i id='bD2Ln'><tr id='bD2Ln'><dt id='bD2Ln'><q id='bD2Ln'><span id='bD2Ln'><b id='bD2Ln'><form id='bD2Ln'><ins id='bD2Ln'></ins><ul id='bD2Ln'></ul><sub id='bD2Ln'></sub></form><legend id='bD2Ln'></legend><bdo id='bD2Ln'><pre id='bD2Ln'><center id='bD2Ln'></center></pre></bdo></b><th id='bD2Ln'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bD2Ln'><tfoot id='bD2Ln'></tfoot><dl id='bD2Ln'><fieldset id='bD2Ln'></fieldset></dl></div>
                            主站蜘蛛池模板: 夜夜爽天天爽 | 午夜精品在线 | 成人免费公开视频 | 午夜专区 | 国产精品视频网站 | 一区二区三区免费 | 国产一级片网站 | 蜜臀久久99精品久久久久宅男 | 91亚洲国产成人久久精品网站 | 日本a视频| www.日本高清 | 国产精品成人国产乱一区 | 大尺度做爰床戏呻吟舒畅 | 精品黑人一区二区三区国语馆 | 四虎永久在线 | 亚洲17p| 黄网免费看 | 国产寡妇亲子伦一区二区三区四区 | 日本黄色视 | 欧美日韩成人在线观看 | 国产成人综合在线 | 黄色国产网站 | 免费啪视频 | 就爱啪啪网 | 国产欧美精品一区 | 国产欧美日韩综合精品 | 在线看的av | 精品一区二区三区在线观看 | 91久久久久国产一区二区 | 亚洲免费高清 | 久久视频一区 | 在线观看亚洲一区 | 国产在线观看网站 | 免费激情网站 | 久久国产精 | 国产农村女人一级毛片 | 日韩三级一区 | 欧美日韩精品久久久免费观看 | 日本69视频| 日韩欧美在线观看 | 四虎在线免费视频 |