Created
January 27, 2016 00:21
-
-
Save plioi/0b318fd56f9ab2b0b0e2 to your computer and use it in GitHub Desktop.
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 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