Last active
October 26, 2019 02:49
-
-
Save scottsauber/66c5f0a5bff4b26f48fd03fda00117be to your computer and use it in GitHub Desktop.
This file contains 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
// 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