When returning Json from a controller (MVC 4 RC) I would like to modify the Json to use camel-casing for the properties and to do this I tried setting the GlobalConfiguration.Formatters.JsonFormatter (not sure if this is correct…don’t have the code in front of me), but this does not appear to affect the Json outputted by the Controller.Json method.
After looking around it appears that this approach would only affect Web API controllers, etc. Is this true? Also, is it possible to alter the Controller.Json() method to acheive this?
Like @rouen suggests, created your own JsonDotNetResult.
This is the one I have in my project:
I then have my own baseController that I inherit from to give me JsonDotNet(object viewModel) type methods.
E.g.