Created
June 13, 2016 16:57
-
-
Save vcsjones/dd9c01f91e9e2122ba04c5f66bc4a80d to your computer and use it in GitHub Desktop.
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
private readonly Random _random = new Random(); | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
// Add framework services. | |
services | |
.AddMvc() | |
.AddJsonOptions(options => | |
options.SerializerSettings.ContractResolver = _random.Next(0, 2) == 0 ? new DefaultContractResolver() : new CamelCasePropertyNamesContractResolver()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment