public ConstructorInstance <T> SelectConstructor(Expression <Func <T> > constructor) { var finder = new ConstructorFinderVisitor <T>(typeof(T)); finder.Visit(constructor); Constructor = finder.Constructor; return(this); }
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; }