Created
July 30, 2014 02:53
-
-
Save imwower/0b246ebd0f33505595e6 to your computer and use it in GitHub Desktop.
Autofac Bootstrapper
This file contains 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
public class Bootstrapper | |
{ | |
public Bootstrapper() | |
{ } | |
private ContainerBuilder builder; | |
private IContainer container; | |
public IContainer Container | |
{ | |
get { return container; } | |
} | |
public ContainerBuilder Init() | |
{ | |
builder = new ContainerBuilder(); | |
LoadAssemblies(builder); | |
return builder; | |
} | |
public void Start() | |
{ | |
container = builder.Build(); | |
} | |
private void LoadAssemblies(ContainerBuilder builder) | |
{ | |
var files = ConfigManager.LoadAssembiles("*.dll"); | |
builder.RegisterAssemblyModules(files); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment