MVC 6 Camel Case JSON

This means, if you have an application which uses both MVC controllers and Web API controllers then you need to apply any custom JSON serialization configurations twice or you should replace JavaScriptSerializer with JSON.NET.

// Sample
 public class Startup
        public void ConfigureServices(IServiceCollection services)
					.Configure<MvcOptions>(options => {

						var jsonOutputFormatter = new JsonOutputFormatter();
						jsonOutputFormatter.SerializerSettings.ContractResolver =
							new CamelCasePropertyNamesContractResolver();
						options.OutputFormatters.Insert(0, jsonOutputFormatter);

        public void Configure(IApplicationBuilder app)
comments powered by Disqus