Skip to content

Instantly share code, notes, and snippets.

@scottsauber
Last active October 26, 2019 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottsauber/66c5f0a5bff4b26f48fd03fda00117be to your computer and use it in GitHub Desktop.
Save scottsauber/66c5f0a5bff4b26f48fd03fda00117be to your computer and use it in GitHub Desktop.
// ASP.NET Core 2.2 and earlier
public void ConfigureServices(IServiceCollection services, IHostingEnvironment hostingEnvironment)
{
services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2)
.AddJsonOptions(options =>
{
options.SerializerSettings.Formatting = hostingEnvironment.IsDevelopment() ? Formatting.Indented : Formatting.None;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment