久久久久久久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>
                            主站蜘蛛池模板: 日韩黄色av | 精品国产一级 | 国产日韩欧美一区二区 | 亚洲精品区 | 久久91精品国产 | 成人精品国产一区二区4080 | 午夜影院 | 亚洲视频在线看 | 欧美又大粗又爽又黄大片视频 | 亚洲精品视频一区二区三区 | 午夜一级黄色片 | 国产精品久久久久久久久久久久午夜片 | 日韩精品在线一区 | 色婷婷在线视频 | 亚洲成人精品久久 | 精品久久久久久久久久久久久久 | 日韩看片 | 欧美激情久久久 | 成人亚洲| 91久久| 手机在线一区二区三区 | 亚洲大片一区 | 99热精品在线 | 久久精品16 | 久久人人爽人人爽人人片av免费 | 国产精品毛片一区二区三区 | 2022国产精品 | 国产精品精品视频一区二区三区 | av黄色免费 | 91精品国产91久久综合桃花 | 亚洲国产精品99久久久久久久久 | 国产在线精品一区二区三区 | 视频精品一区二区三区 | 天天草天天干 | 国产精品视频999 | 美女在线视频一区二区三区 | 在线āv视频 | 国产一区二区三区在线观看免费 | 一区二区三区欧美在线 | 欧美一卡二卡在线观看 | 9999在线视频 |