Skip to content

Instantly share code, notes, and snippets.

@imwower
Created July 30, 2014 02:53
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/0b246ebd0f33505595e6 to your computer and use it in GitHub Desktop.
Save imwower/0b246ebd0f33505595e6 to your computer and use it in GitHub Desktop.
Autofac Bootstrapper
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