Force CamelCase on ASP.NET WebAPI Per Controller

后端 未结 4 818
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 07:04

In ASP.NET WebAPI, I know you can set the default json formatter to use camel case using CamelCasePropertyNamesContractResolver() in the global.aspx which will force ALL jso

4条回答
  •  佛祖请我去吃肉
    2020-11-29 07:57

    I know this is pretty old, but I had a problem with the accepted answer because there were other necessary changes to the formatter that were no longer present after removing and re-adding. I did this by just modifying the existing formatter as shown in this Gist: https://gist.github.com/mauricedb/5356933.

提交回复
热议问题