Skip to content

Instantly share code, notes, and snippets.

@vcsjones
Created June 13, 2016 16:57
Show Gist options
  • Save vcsjones/dd9c01f91e9e2122ba04c5f66bc4a80d to your computer and use it in GitHub Desktop.
Save vcsjones/dd9c01f91e9e2122ba04c5f66bc4a80d to your computer and use it in GitHub Desktop.
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