Convert Boolean to condition in Expression tree
Hi Experts How I Can convert this statement to Expression tree:
x=>x.Contains("bla")
开发者_如何学编程thanks
var parameter = Expression.Parameter(typeof(string), "x");
var lambda = Expression.Lambda<Func<string, bool>>(
Expression.Call(
parameter,
"Contains",
Type.EmptyTypes,
Expression.Constant(
"blah"
)
),
parameter
);
精彩评论