Answers for "json serialize object capitalization config"

C#
0

json serialize object capitalization config

protected void Application_Start() {
    JsonConfig.Configure();   
}

public static class JsonConfig
{
    public static void Configure(){
        var formatters = GlobalConfiguration.Configuration.Formatters;
        var jsonFormatter = formatters.JsonFormatter;
        var settings = jsonFormatter.SerializerSettings;

        settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
    }
}
Posted by: Guest on June-18-2020

C# Answers by Framework

Browse Popular Code Answers by Language