Created
May 14, 2014 15:48
-
-
Save pmhsfelix/859f1f736c13efd6b66f to your computer and use it in GitHub Desktop.
Controller registration using autofac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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