public static void Execute()
{
if (Container != null)
return;
Container = new Container();
SetServiceLocator(Container);
Container.Configure(c =>
{
c.Scan(s =>
{
s.AssembliesForApplication();
s.TheCallingAssembly();
s.AddAllTypesOf<IBootstrapItem>();
s.WithDefaultConventions();
s.LookForRegistries();
});
c.For(typeof (Lazy<>))
.Use(typeof (Lazy<>));
c.For<IServiceLocator>().Use(context=>new StructureMapServiceLocator(context.GetInstance<IContainer>()));
});
}