Brivvirs Brivvirs - 10 months ago 94
C# Question core 1.0 web api use camelcase

On rc2 the same code return json format with camel case. After core 1.0 release i started new project and the same code is returning json in lowercase.

Tried multiple solutions but none of them solved problem

Answer Source
               .AddJsonOptions(options =>
                   options.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver();

this keeps json object name the same as .net class property.