Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

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