Ejemplo n.º 1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);

            StructureMapConfiguration.Initialize();

            var controllerFactory = new StructureMapControllerFactory(ObjectFactory.Container);

            ControllerBuilder.Current.SetControllerFactory(controllerFactory);

            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new NestedContainerViewEngine());
        }
Ejemplo n.º 2
0
        public static void Bootstrap()
        {
            if (!_initialized)
            {
                lock (_lock)
                {
                    if (!_initialized)
                    {
                        _initialized = true;

                        StructureMapConfiguration.Initialize();

                        var startupTasks = ObjectFactory.GetAllInstances <IStartupTask>();

                        startupTasks.Each(task => task.Execute());
                    }
                }
            }
        }