public GenericInvoker(Expression <T> expression) { this.expression = expression; this.numParams = GenericParametersVisitor.GenericParameters(expression); ParameterExpression tp = Expression.Parameter(typeof(Type[])); }
public static int GenericParameters(LambdaExpression expression) { var gpv = new GenericParametersVisitor(); gpv.Visit(expression); if (gpv.parameters == null) { throw new InvalidOperationException("No generic method or constructor found on expression:\r\n{0}".FormatWith(expression.ToString())); } return(gpv.parameters.Value); }