Skip to content

Instantly share code, notes, and snippets.

@imwower
Created July 30, 2014 03:06
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 imwower/56dfcf33ec2274e8cd9f to your computer and use it in GitHub Desktop.
Save imwower/56dfcf33ec2274e8cd9f to your computer and use it in GitHub Desktop.
ASP MVC Error Handler Module
public class ErrorHandlerModule : Autofac.Module
{
protected override void Load(ContainerBuilder builder)
{
base.Load(builder);
builder.RegisterType<MvcErrorAttribute>()
.As<HandleErrorAttribute>()
.PropertiesAutowiredWithParameters();
var assemblies = ConfigManager.LoadAssembiles("ErrorHandler.dll");
builder.RegisterControllers(assemblies)
.PropertiesAutowiredWithParameters();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment