I'm using Asp.net Core Razor Pages and I'm returning json. I need the json to be in camel casing across the board, therefore I tried to set the resolver in Startup.cs like this
services.AddMvc()
.AddJsonOptions(options => {
options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
});
However this does not work, the razor page is still returning json in Pascal casing. How do I correct the issue? Thank you.