Aperea.Infrastructure.IoC.RegisterStructureMap.Execute C# (CSharp) Method

Execute() public static method

public static Execute ( ) : void
return void
        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>()));
            });
        }
RegisterStructureMap