How to return large Json in Asp.Net Core

混江龙づ霸主 提交于 2019-12-10 17:21:24

问题


In classic asp.net in order to return large json data i enable it web.config

  <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="2147483644"/>
      </webServices>
    </scripting>
  </system.web.extensions>

and then also set the max length in action method

public ActionResult GetData()
{
        var data = _service.GetData();
        var json = Json(data);
        json.MaxJsonLength = Int32.MaxValue;
        return json;
}

what is equivalent in ASP.NET core? In asp.net core I don't see JsonResult has MaxJsonLength proeprty

来源:https://stackoverflow.com/questions/48271054/how-to-return-large-json-in-asp-net-core

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!