Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Last active March 23, 2016 10:16
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 justinyoo/9e98ecbe651733a18aa9 to your computer and use it in GitHub Desktop.
Save justinyoo/9e98ecbe651733a18aa9 to your computer and use it in GitHub Desktop.
ASP.NET Core Tips & Tricks
public IServiceProvider ConfigureServices(IServiceCollection services)
{
...
this.ConfigureMvc(services, this.LoggerFactory);
...
}
private void ConfigureMvc(IServiceCollection services, ILoggerFactory logger)
{
var builder = services.AddMvc();
...
// Setup global exception filters
builder.AddMvcOptions(o => { o.Filters.Add(new GlobalExceptionFilter(logger)); });
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment