public static void Start()
 {
     IContainer container = IoC.Initialize();
     StructureMapDependencyScope = new StructureMapDependencyScope(container);
     DependencyResolver.SetResolver(StructureMapDependencyScope);
     DynamicModuleUtility.RegisterModule(typeof(StructureMapScopeModule));
 }
Beispiel #2
0
        protected override void CustomizeFixture(IFixture fixture)
        {
            var scope = new StructureMapDependencyScope(IntegrationTestContainerFactory.Container);
            var contextFixture = new TestContextFixture(scope);
            contextFixture.SetUp();

            //fixture.Customizations.Add(scope.GetInstance<IntegrationTestDefaultValueBuilder>());
            fixture.Register(() => contextFixture);
            fixture.Customizations.Add(new ContainerBuilder(scope)); // always last
        }
Beispiel #3
0
 public static void Initialize()
 {
     lock (_syncRoot)
     {
         if (!_isInitialized)
         {
             Container          = ContainerFactory.Initialize();
             ServiceLocator     = new StructureMapDependencyScope(Container);
             DependencyResolver = new StructureMapDependencyResolver(Container);
             StructuremapMvc.StructureMapDependencyScope = new StructureMapDependencyScope(Container);
             DynamicModuleUtility.RegisterModule(typeof(StructureMapScopeModule));
             DynamicModuleUtility.RegisterModule(typeof(PopForumsLoggingModule));
             _isInitialized = true;
         }
     }
 }
Beispiel #4
0
        public static void Start()
        {
            var container = IoC.Initialize();

            StructureMapDependencyScope = new StructureMapDependencyScope(container);
            DependencyResolver.SetResolver(StructureMapDependencyScope);
            DynamicModuleUtility.RegisterModule(typeof(StructureMapScopeModule));

            Mapper.Initialize(cfg =>
            {
                foreach (var profile in DependencyResolver.Current.GetServices <Profile>())
                {
                    cfg.AddProfile(profile);
                }
            });
        }
Beispiel #5
0
        public static void Start()
        {
            var soapEndpointName    = ConfigurationManager.AppSettings["gw:soap-endpoint-name"];
            var openWeatherMapUrl   = ConfigurationManager.AppSettings["owm:url"];
            var openWeatherMapAppId = ConfigurationManager.AppSettings["owm:appid"];


            var registry = new Registry();

            registry.IncludeRegistry(new DefaultRegistry());
            registry.IncludeRegistry(new ServicesRegistry(IoC.GetInstance(), soapEndpointName, openWeatherMapUrl, openWeatherMapAppId));
            var container = IoC.GetInstance().Initialize(registry);


            //IContainer container = IoC.Initialize();
            StructureMapDependencyScope = new StructureMapDependencyScope(container);
            DependencyResolver.SetResolver(StructureMapDependencyScope);
            DynamicModuleUtility.RegisterModule(typeof(StructureMapScopeModule));
        }
        /// <summary>
        /// <para>
        /// Invoked from <see cref="StartupExtended.Configure"/>.
        /// </para>
        /// </summary>
        public static void Start()
        {
            StructureMapDependencyScope = StructureMapDependencyScopeFactory.ConfigureContainer();

            // --------------------------------------------------
            //Register container so that App.Core.Infrastructure.ServiceLocatorInitiator
            //Can get back to it:
            StructureMapContainerLocator.Register(
                () => StructureMapDependencyScope.Container);
            // --------------------------------------------------

            DependencyResolver.SetResolver(StructureMapDependencyScope);
            DynamicModuleUtility.RegisterModule(typeof(StructureMapScopeModule));

            // Find out what is available in the container:
            //container.Model.For<IFantasySeries>()
            //    .Instances.Select(x => x.ReturnedType)
            //    .OrderBy(x => x.Name)
            //    .ShouldHaveTheSameElementsAs(typeof(BlackCompany), typeof(GameOfThrones), typeof(WheelOfTime));
        }
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            //BundleConfig.RegisterBundles(BundleTable.Bundles);
            //Setting Cinfiguration
            this.container = StructureMapContainerInit.InitializeContainer();
            StructureMapDependencyScope = new StructureMapDependencyScope(container);
            DependencyResolver.SetResolver(StructureMapDependencyScope);
            GlobalConfiguration.Configuration.DependencyResolver = new StructureMapWebApiDependencyResolver(container);
            ////NEED FIX HERE


            AutoMapperConfiguration.Configure(this.container);

            validateBus = container.GetInstance <IValidateBus>();

            ////Listen for when content is being saved
            ContentService.Publishing += ContentService_Publishing;


            //TreeControllerBase.MenuRendering += TreeControllerBase_MenuRendering;
        }
Beispiel #8
0
 public static void End()
 {
     StructureMapDependencyScope.Dispose();
 }
 public ContainerBuilder(StructureMapDependencyScope scope)
 {
     this.scope = scope;
 }
 public static void Start()
 {
     StructureMapDependencyScope = new StructureMapDependencyScope(IoC.Container);
     DependencyResolver.SetResolver(StructureMapDependencyScope);
     DynamicModuleUtility.RegisterModule(typeof(StructureMapScopeModule));
 }
Beispiel #11
0
 public TestContextFixture(StructureMapDependencyScope scope)
 {
     this.scope = scope;
 }
Beispiel #12
0
 public ContainerBuilder(StructureMapDependencyScope scope)
 {
     this.scope = scope;
 }