示例#1
0
        public BuildStepPlanner(Type serviceType, Type concreteType, ServiceGraph graph, IMethodVariables method)
        {
            if (!concreteType.IsConcrete())
            {
                throw new ArgumentOutOfRangeException(nameof(concreteType), "Must be a concrete type");
            }

            ConcreteType = concreteType;
            _graph       = graph;
            _method      = method;


            var ctor = graph.ChooseConstructor(concreteType);

            if (ctor == null)
            {
                CanBeReduced = false;
            }
            else
            {
                Top = new ConstructorBuildStep(serviceType, concreteType, ServiceLifetime.Scoped, ctor);
                Visit(Top);
            }
        }