Skip to content

Instantly share code, notes, and snippets.

@ThatRendle
Created September 11, 2014 11:47
Show Gist options
  • Select an option

  • Save ThatRendle/59907cfa2e9440aeff09 to your computer and use it in GitHub Desktop.

Select an option

Save ThatRendle/59907cfa2e9440aeff09 to your computer and use it in GitHub Desktop.
This cannot be right
services.AddMvc()
.SetupOptions<MvcOptions>(options =>
{
var currentJson = options.OutputFormatters.FirstOrDefault(f => f.Instance is JsonOutputFormatter);
if (currentJson != null) options.OutputFormatters.Remove(currentJson);
options.OutputFormatters.Add(new JsonOutputFormatter(new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }, false));
});
@DaveVdE
Copy link
Copy Markdown

DaveVdE commented Sep 12, 2014

I agree. There's OfType<> to use instead of is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment