嗨专家 我如何将此语句转换为表达式树:
x=>x.Contains("bla")
感谢
答案 0 :(得分:0)
var parameter = Expression.Parameter(typeof(string), "x");
var lambda = Expression.Lambda<Func<string, bool>>(
Expression.Call(
parameter,
"Contains",
Type.EmptyTypes,
Expression.Constant(
"blah"
)
),
parameter
);