From 6a2a3d953275afccd7181f095252c5219303f8fc Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Fri, 8 Apr 2016 11:34:53 +0100 Subject: [PATCH] Fix JSON formatting in Angular2Spa template --- templates/Angular2Spa/Startup.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/Angular2Spa/Startup.cs b/templates/Angular2Spa/Startup.cs index ef18627..ce8338c 100755 --- a/templates/Angular2Spa/Startup.cs +++ b/templates/Angular2Spa/Startup.cs @@ -18,7 +18,10 @@ namespace WebApplicationBasic // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - services.AddMvc(); + services.AddMvc().AddJsonOptions(options => + { + options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.