日期:2014-05-20 浏览次数:20807 次
foreach (PropertyInfo propertyInfo in propertyInfos)
{
if (propertyInfo.Name == "id")
continue;
Expression right = Expression.Call
(
Expression.Property(left, typeof(T).GetProperty(propertyInfo.Name).Name),
typeof(string).GetMethod("Contains", new Type[] { typeof(string) }),
Expression.Constant(SearchString)
);
expression = Expression.Or(right, expression);
}