Created
March 14, 2016 13:14
-
-
Save nbellocam/147a7d47c7a90490798e to your computer and use it in GitHub Desktop.
Asp.net core: Configure MVC to use camelCase for json serializer
This file contains 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(options => | |
{ | |
options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); | |
options.SerializerSettings.DefaultValueHandling = DefaultValueHandling.Include; | |
options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment