public static IReadOnlyList <ConstructorArgumentProducer> ConvertToProducers(
            this IReadOnlyList <DetectedMethodArgument> constructorArguments,
            ClusterBindings clusterBindings,
            BindingExtender bindingExtender
            )
        {
            if (constructorArguments is null)
            {
                throw new ArgumentNullException(nameof(constructorArguments));
            }

            if (clusterBindings is null)
            {
                throw new ArgumentNullException(nameof(clusterBindings));
            }

            if (bindingExtender is null)
            {
                throw new ArgumentNullException(nameof(bindingExtender));
            }

            return(constructorArguments.OrderBy(ca => ca.ArgumentIndex).Select(
                       bft => new ConstructorArgumentProducer(
                           clusterBindings,
                           bindingExtender,
                           bft
                           )
                       ).ToList());
        }
        public ConstructorArgumentProducer(
            ClusterBindings clusterBindings,
            BindingExtender bindingExtender,
            DetectedMethodArgument constructorArgument
            )
        {
            if (clusterBindings is null)
            {
                throw new ArgumentNullException(nameof(clusterBindings));
            }

            if (bindingExtender is null)
            {
                throw new ArgumentNullException(nameof(bindingExtender));
            }

            if (constructorArgument is null)
            {
                throw new ArgumentNullException(nameof(constructorArgument));
            }

            ClusterBindings     = clusterBindings;
            BindingExtender     = bindingExtender;
            ConstructorArgument = constructorArgument;
        }
Example #3
0
        public InstanceProduct(
            BindingExtender bindingExtender,
            IMethodProduct?predicateMethod,
            IMethodProduct factoryObjectMethod,
            IMethodProduct funcMethod,
            IMethodProduct?disposeMethod,
            IReadOnlyList <UnknownTypeProduct>?unknownTypeProducts
            )
        {
            if (bindingExtender is null)
            {
                throw new ArgumentNullException(nameof(bindingExtender));
            }

            if (factoryObjectMethod is null)
            {
                throw new ArgumentNullException(nameof(factoryObjectMethod));
            }

            if (funcMethod is null)
            {
                throw new ArgumentNullException(nameof(funcMethod));
            }

            BindingExtender     = bindingExtender;
            PredicateMethod     = predicateMethod;
            FactoryObjectMethod = factoryObjectMethod;
            FuncMethod          = funcMethod;
            DisposeMethod       = disposeMethod;
            UnknownTypeProducts = unknownTypeProducts ?? new List <UnknownTypeProduct>();
        }
        public ConstantInstanceProducer(
            ITypeInfoProvider typeInfoProvider,
            ClusterBindings clusterBindings,
            BindingExtender bindingExtender
            )
        {
            if (typeInfoProvider is null)
            {
                throw new ArgumentNullException(nameof(typeInfoProvider));
            }

            if (clusterBindings is null)
            {
                throw new ArgumentNullException(nameof(clusterBindings));
            }

            if (bindingExtender is null)
            {
                throw new ArgumentNullException(nameof(bindingExtender));
            }
            _typeInfoProvider = typeInfoProvider;
            _clusterBindings  = clusterBindings;
            _bindingExtender  = bindingExtender;
        }