8,497
社区成员
发帖
与我相关
我的任务
分享
ParameterExpression c = Expression.Parameter(typeof(Customer), "c");
Expression condition = Expression.Constant(false);
foreach (string s in starts)
{
Expression con = Expression.Call(
Expression.Property(c, typeof(Customer).GetProperty("CustomerID")),
typeof(string).GetMethod("StartsWith",
new Type[] { typeof(string) }),
Expression.Constant(s));
condition = Expression.Or(con, condition);
}
Expressionbool>> end =
Expression.Lambdabool>>
(condition, new ParameterExpression[] { c });