1
//IsCellDataValid Method returns bool
MethodInfo isCellDataValidMethod = this.GetType().GetMethod("IsCellDataValid", BindingFlags.NonPublic | BindingFlags.Instance);

var IsCellDataValidMethodCall = Expression.Call(ruleEngineInstance, isCellDataValidMethod, new ParameterExpression[] { method params});

var cellDataValidConstantExp = ConstantExpression.IsTrue(IsCellDataValidMethodCall);

//GetCellTypeCount returns Int
var isCellDataValidExpression = Expression.IfThen(cellDataValidConstant,
                                                  GetCellTypeCountMethodCall);

现在我想将它的输出与cellTypeCountExpression用户输入的值进行比较,并且不希望编译表达式以获得结果然后构建一个Constant Expression

我有类似的东西

var resultBinaryExp = ParameterExpression.LessThan(GetCellTypeCountMethodCall, 
                               Expression.Constant(userEnteredValu), typeof(int));
4

0 回答 0