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

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

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

      1. asp.net core 1.0 web api使用camelcase

        时间:2023-08-22
        <legend id='x4yeO'><style id='x4yeO'><dir id='x4yeO'><q id='x4yeO'></q></dir></style></legend>

        • <small id='x4yeO'></small><noframes id='x4yeO'>

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

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

                1. 本文介绍了asp.net core 1.0 web api使用camelcase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  RC2 上,相同的代码返回带有驼峰式大小写的 json 格式.在 netcore 1.0 发布后,我开始了新项目,并且相同的代码以小写形式返回 json.

                  On RC2 the same code returns json format with camel case. After netcore 1.0 release i started new project and the same code is returning json in lowercase.

                  尝试了多种解决方案,但都没有奏效web-api-serialize-properties-starting-from-lowercase-letter

                  Tried multiple solutions but none of them were working web-api-serialize-properties-starting-from-lowercase-letter

                  推荐答案

                  services
                      .AddMvc()
                      .AddJsonOptions(options =>
                      {
                          options.SerializerSettings.ContractResolver
                              = new Newtonsoft.Json.Serialization.DefaultContractResolver();
                      });
                  

                  这使 JSON 对象的名称与 .NET 类属性保持一致.

                  This keeps a JSON object's name the same as .NET class property.

                  这篇关于asp.net core 1.0 web api使用camelcase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 xml 序列化期间忽略属性,但在反序列化期间不 下一篇:如何在 C# 应用程序中导入 JsonConvert?

                  相关文章

                  最新文章

                  <tfoot id='Xp0LC'></tfoot>

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

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

                    1. <legend id='Xp0LC'><style id='Xp0LC'><dir id='Xp0LC'><q id='Xp0LC'></q></dir></style></legend>