Force CamelCase on ASP.NET WebAPI Per Controller

后端 未结 4 817
隐瞒了意图╮
隐瞒了意图╮ 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:53

    Yes, it's possible...you can use IControllerConfiguration to define per-controller specific configuration..

    This is a sample which describes this scenario. You can quickly take a look at how this interface should be used over here(from the sample).

提交回复
热议问题