Skip to content

Instantly share code, notes, and snippets.

@plioi
Created January 27, 2016 00:21
Show Gist options
  • Save plioi/0b318fd56f9ab2b0b0e2 to your computer and use it in GitHub Desktop.
Save plioi/0b318fd56f9ab2b0b0e2 to your computer and use it in GitHub Desktop.
public static class IoC
{
private static readonly Lazy<IContainer> Bootstrapper = new Lazy<IContainer>(Initialize, true);
public static IContainer Container => Bootstrapper.Value;
private static IContainer Initialize()
{
return new Container(cfg =>
{
cfg.Scan(scan =>
{
scan.TheCallingAssembly();
scan.LookForRegistries();
scan.WithDefaultConventions();
scan.With(new ControllerConvention());
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment