コード例 #1
0
        protected override void OnFinalizeBinding(DiContainer container)
        {
            var provider = _factoryBindInfo.ProviderFunc(container);

            RegisterProviderForAllContracts(
                container,
                new CachedProvider(
                    new TransientProvider(
                        _factoryBindInfo.FactoryType,
                        container,
                        InjectUtil.CreateArgListExplicit(
                            provider,
                            new InjectContext(container, typeof(TContract))),
                        null,
                        BindInfo.ContextInfo)));
        }
コード例 #2
0
        protected override void OnFinalizeBinding(DiContainer container)
        {
            var factory = new FactoryProviderWrapper <TContract>(
                _factoryBindInfo.ProviderFunc(container), new InjectContext(container, typeof(TContract)));

            var settings = new MemoryPoolSettings()
            {
                InitialSize  = _poolBindInfo.InitialSize,
                ExpandMethod = _poolBindInfo.ExpandMethod,
            };

            RegisterProviderForAllContracts(
                container,
                new CachedProvider(
                    new TransientProvider(
                        _factoryBindInfo.FactoryType,
                        container,
                        InjectUtil.CreateArgListExplicit(factory, settings),
                        null,
                        BindInfo.ContextInfo)));
        }