• <small id='3pg1E'></small><noframes id='3pg1E'>

    <tfoot id='3pg1E'></tfoot>
    • <bdo id='3pg1E'></bdo><ul id='3pg1E'></ul>
      <legend id='3pg1E'><style id='3pg1E'><dir id='3pg1E'><q id='3pg1E'></q></dir></style></legend>

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

        将 Newtonsoft.Json.Linq.JArray 转换为特定对象类型的列

        时间:2023-08-24
        <tfoot id='CW4Gv'></tfoot>

          <tbody id='CW4Gv'></tbody>

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

            <legend id='CW4Gv'><style id='CW4Gv'><dir id='CW4Gv'><q id='CW4Gv'></q></dir></style></legend>
          • <small id='CW4Gv'></small><noframes id='CW4Gv'>

              • <bdo id='CW4Gv'></bdo><ul id='CW4Gv'></ul>
                  本文介绍了将 Newtonsoft.Json.Linq.JArray 转换为特定对象类型的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有以下 {Newtonsoft.Json.Linq.JArray} 类型的变量.

                  I have the following variable of type {Newtonsoft.Json.Linq.JArray}.

                  properties["Value"] {[
                    {
                      "Name": "Username",
                      "Selected": true
                    },
                    {
                      "Name": "Password",
                      "Selected": true
                    }
                  
                  ]}
                  

                  我想要完成的是将其转换为 List 其中 SelectableEnumItem 是以下类型:

                  What I want to accomplish is to convert this to List<SelectableEnumItem> where SelectableEnumItem is the following type:

                  public class SelectableEnumItem
                      {
                          public string Name { get; set; }
                          public bool Selected { get; set; }
                      }
                  

                  我对编程比较陌生,我不确定这是否可行.任何有关工作示例的帮助将不胜感激.

                  I am rather new to programming and I am not sure whether this is possible. Any help with working example will be greatly appreciated.

                  推荐答案

                  只需调用 array.ToObject>() 方法即可.它会返回你需要的东西.

                  Just call array.ToObject<List<SelectableEnumItem>>() method. It will return what you need.

                  文档:将 JSON 转换为类型

                  这篇关于将 Newtonsoft.Json.Linq.JArray 转换为特定对象类型的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:将特定枚举反序列化为 Json.Net 中的 system.enum 下一篇:如何使用 EF Core 将 JSON 存储在实体字段中?

                  相关文章

                  最新文章

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

                      <bdo id='dihbQ'></bdo><ul id='dihbQ'></ul>

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

                    1. <tfoot id='dihbQ'></tfoot>