示例#1
0
        public ConstructorInstance <T> SelectConstructor(Expression <Func <T> > constructor)
        {
            var finder = new ConstructorFinderVisitor <T>(typeof(T));

            finder.Visit(constructor);

            Constructor = finder.Constructor;

            return(this);
        }
示例#2
0
        public ConstructorInstance <TImplementation, TService> SelectConstructor(Expression <Func <TImplementation> > constructor)
        {
            var finder = new ConstructorFinderVisitor <TImplementation>(typeof(TImplementation));

            finder.Visit(constructor);

            Constructor = finder.Constructor;

            return(this);
        }
        public void UseConstructor(Expression expression)
        {
            var finder = new ConstructorFinderVisitor();

            finder.Visit(expression);

            ConstructorInfo ctor = finder.Constructor;

            if (ctor == null)
            {
                throw new ApplicationException("Not a valid constructor function");
            }

            _ctor = ctor;
        }
示例#4
0
        public void UseConstructor(Expression expression)
        {
            var finder = new ConstructorFinderVisitor();
            finder.Visit(expression);

            ConstructorInfo ctor = finder.Constructor;
            if (ctor == null)
            {
                throw new ApplicationException("Not a valid constructor function");
            }

            _ctor = ctor;
        }