Last active
February 21, 2016 11:18
-
-
Save justinyoo/58785e8e8b9f277bb690 to your computer and use it in GitHub Desktop.
ASP.NET Core Tips & Tricks
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
public IServiceProvider ConfigureServices(IServiceCollection services) | |
{ | |
var builder = services.AddMvc(); | |
builder.AddJsonOptions( | |
o => | |
{ | |
o.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); | |
o.SerializerSettings.Converters.Add(new StringEnumConverter()); | |
o.SerializerSettings.Formatting = Formatting.Indented; | |
o.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; | |
o.SerializerSettings.MissingMemberHandling = MissingMemberHandling.Ignore; | |
}); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment