protected override void ConfigureRequestContainer(global::Nancy.TinyIoc.TinyIoCContainer container, NancyContext context)
        {
            base.ConfigureRequestContainer(container, context);

            var docStore = container.Resolve<IDocumentStore>("DocStore");
            var session = docStore.OpenSession();
            container.Register<IDocumentSession>(session);
        }
Example #2
0
        public void RegisterServices(global::SimpleInjector.Container container)
        {
            container.Register<ISitecoreContext>(() => new SitecoreContext());
            container.Register<IMetadataLogic, MetadataLogic>();
            container.Register<IScriptsLogic, ScriptsLogic>();
            container.Register<ISitecoreSiteLogic, SitecoreSiteLogic>();
            container.Register<IDateTimeLogic, DateTimeLogic>();
            container.Register<ICanonicalLink, CanonicalLink>();
            container.Register<ISettingsLogic, SettingsLogic>();

            container.Register<ICacheLogic, CacheLogic>();
            //singleton
            container.Register<ICacheRepositoryLogic, CacheRepositoryLogic>(Lifestyle.Singleton);
        }
		public void Install(global::Castle.Windsor.IWindsorContainer container, global::Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
		{
			new RhinoServiceBusConfiguration()
				.UseCastleWindsor(container)
				.Configure();
			
			// castle is not able to resolve references right now, we need another support interface to delay the bust start outside the installer calls
			// container.Resolve<IStartableServiceBus>().Start(); -> this will throw an exception.
			container.Register(Component.For<IStartableBus>().ImplementedBy<Startable>().LifeStyle.Transient);
		}
        public RabbitMQIntegrationModule(global::SimpleInjector.Container container)
        {
            container.Register<IRabbitBus, RabbitBus>(SimpleInjector.Lifestyle.Transient);

            var handler = DefineBusHandler();

            IBus bus = RabbitHutch.CreateBus(ConfigHelper.ConnectionString, handler, serviceRegister => serviceRegister
                     .Register<IEasyNetQLogger, QueueLogManager>()
                     .Register<IConsumerErrorStrategy, ErrorStrategy>());

            container.RegisterSingle<IBus>(bus);

            this.container = container;
        }
Example #5
0
        protected override void ConfigureApplicationContainer(global::Nancy.TinyIoc.TinyIoCContainer container)
        {
            // TODO: support multiple doc-stores
            var docStore = new DocumentStore { ConnectionStringName = "RavenDB" };
            var conventions = docStore.Conventions;

            conventions.FindFullDocumentKeyFromNonStringIdentifier = (o, type, arg3) =>
            {
                var ret = conventions.DefaultFindFullDocumentKeyFromNonStringIdentifier(o, type, arg3);
                var areaConfigs = HttpContext.Current.Items["AreaConfigs"] as AreaConfigs;
                if (areaConfigs != null)
                    ret = areaConfigs.DocumentsPrefix + ret;

                return ret;
            };

            conventions.TransformTypeTagNameToDocumentKeyPrefix = s =>
            {
                var ret = DocumentConvention.DefaultTransformTypeTagNameToDocumentKeyPrefix(s);
                var areaConfigs = HttpContext.Current.Items["AreaConfigs"] as AreaConfigs;
                if (areaConfigs != null)
                    ret = areaConfigs.DocumentsPrefix + ret;

                return ret;
            };

            docStore.Initialize();
            container.Register<IDocumentStore>(docStore, "DocStore");

            base.ConfigureApplicationContainer(container);
        }
Example #6
0
        protected override void ConfigureApplicationContainer(global::Nancy.TinyIoc.TinyIoCContainer container)
        {
            if (ConfigurationManager.AppSettings["DisableDynamicViewLoading"] == "true")
                NSembleViewLocationProvider.DisableDynamicViewLoading = true;

            // TODO: support multiple doc-stores
            var docStore = new DocumentStore { ConnectionStringName = "RavenDB" };
            var conventions = docStore.Conventions;

            conventions.FindFullDocumentKeyFromNonStringIdentifier = (o, type, arg3) =>
            {
                var ret = conventions.DefaultFindFullDocumentKeyFromNonStringIdentifier(o, type, arg3);
                var areaConfigs = HttpContext.Current.Items["AreaConfigs"] as AreaConfigs;
                if (areaConfigs != null)
                    ret = areaConfigs.DocumentsPrefix + ret;

                return ret;
            };

            conventions.TransformTypeTagNameToDocumentKeyPrefix = s =>
            {
                var ret = DocumentConvention.DefaultTransformTypeTagNameToDocumentKeyPrefix(s);
                var areaConfigs = HttpContext.Current.Items["AreaConfigs"] as AreaConfigs;
                if (areaConfigs != null)
                    ret = areaConfigs.DocumentsPrefix + ret;

                return ret;
            };

            AppDomainAssemblyTypeScanner.LoadAssembliesWithNancyReferences();

            docStore.Initialize();
            container.Register<IDocumentStore>(docStore, "DocStore");

            base.ConfigureApplicationContainer(container);
        }
 public void Register(global::LightCore.IContainerBuilder builder)
 {
     builder.Register<ISample01, Sample01>();
 }