Last active
May 15, 2019 14:09
-
-
Save vmandic/a93233c1eb22529a259ee6d1ceb2d3a2 to your computer and use it in GitHub Desktop.
meds-processor, part/4, snippet #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddMvc().AddJsonOptions(opts => | |
{ | |
opts.SerializerSettings.ContractResolver = new DefaultContractResolver | |
{ | |
NamingStrategy = new SnakeCaseNamingStrategy() | |
}; | |
opts.SerializerSettings.Formatting = Formatting.Indented; | |
opts.SerializerSettings.Converters.Add(new StringEnumConverter()); | |
opts.SerializerSettings.DateFormatString = "yyyy-MM-dd"; | |
opts.SerializerSettings.DefaultValueHandling = DefaultValueHandling.Ignore; | |
opts.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; | |
}).SetCompatibilityVersion(CompatibilityVersion.Version_2_1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment