Skip to content

Instantly share code, notes, and snippets.

@pmhsfelix
Created May 14, 2014 15:48
Show Gist options
  • Save pmhsfelix/859f1f736c13efd6b66f to your computer and use it in GitHub Desktop.
Save pmhsfelix/859f1f736c13efd6b66f to your computer and use it in GitHub Desktop.
Controller registration using autofac
var config = new HttpConfiguration();
var builder = new ContainerBuilder();
foreach (var type in config.Services
.GetHttpControllerSelector()
.GetControllerMapping().Select(p => p.Value.ControllerType))
{
builder.RegisterType(type);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment