【发布时间】:2013-07-09 05:24:47
【问题描述】:
我正在使用 Dynamic-Expresso 库。 我想评估包含 foreach 语句的表达式。 那可能吗? 我能看到的唯一方法是编写参数化方法并将整个类作为参数发送给解释器
var target = new Interpreter();
target.SetVariable("a", a, typeof(Tools));
target.SetVariable("b", b, typeof(List<param>));
if (target.Eval("a.MethodWithForeach(b)").Equals(true))
{
...
}
【问题讨论】:
标签: c# dynamic-expresso