O'Reilly logo
  • MQ Tran thinks this is interesting:

if (env.IsDevelopment()) 1 { 1 app.UseDeveloperExceptionPage(); 1 } 1 else 2 { 2 app.UseExceptionHandler("/Home/Error"); 2 } ...

From

Cover of ASP.NET Core in Action

Note

I do not like to have different code paths for different environments. I'd rather have the same code but behave differently for different environments basing on configurations.