Skip to content

Instantly share code, notes, and snippets.

@plioi plioi/IoC.cs
Created Jan 27, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.