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()); }
public static void Bootstrap() { if (!_initialized) { lock (_lock) { if (!_initialized) { _initialized = true; StructureMapConfiguration.Initialize(); var startupTasks = ObjectFactory.GetAllInstances <IStartupTask>(); startupTasks.Each(task => task.Execute()); } } } }