Skip to content

Instantly share code, notes, and snippets.

@scottsauber
Created October 30, 2019 02:53
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/b4be83ef28af3ff960efbe2f84ad8a3f to your computer and use it in GitHub Desktop.
Save scottsauber/b4be83ef28af3ff960efbe2f84ad8a3f to your computer and use it in GitHub Desktop.
public class Startup
{
private readonly IWebHostEnvironment _environment;
public Startup(IWebHostEnvironment environment)
{
_environment = environment;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers()
.AddJsonOptions(options => options.JsonSerializerOptions.WriteIndented = _environment.IsDevelopment());
}
// Other code ommitted for brevity
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment