Brivvirs Brivvirs - 1 year ago 181
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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download