Ejemplo n.º 1
0
        public static IWindsorContainer ConfigureForNode(this IWindsorContainer container)
        {
            InstallConfiguration installConfiguration = new InstallConfiguration
            {
                ServiceProfiles = new[] { ServiceAttribute.DefaultProfile },
                ScopedLifestyle = lf => lf.PerThread
            };

            return(container.ConfigureForAll(installConfiguration));
        }
Ejemplo n.º 2
0
        private static IWindsorContainer ConfigureForAll(this IWindsorContainer container, InstallConfiguration installConfiguration)
        {
            // umožní resolvovat i kolekce závislostí - IEnumerable<IDependency>
            container.Kernel.Resolver.AddSubResolver(new CollectionResolver(container.Kernel));

            // facilities
            container.AddFacility <TypedFactoryFacility>();
            container.Register(Component.For(typeof(IServiceFactory <>)).AsFactory());

            InstallHavitServices(container);

            container.InstallByServiceAttibute(typeof(BlockchainTurorial.Services.Properties.AssemblyInfo).Assembly, installConfiguration.ServiceProfiles, installConfiguration.ScopedLifestyle);

            return(container);
        }