我想创建一个超过 3-4 Expression.Or 的查询?但是 Expression.Or 只是让我在其中添加两个表达式。
if (!string.IsNullOrEmpty(keyword))
query
.Add(Expression.Or(
Expression.Like("Name", keyword, MatchMode.Anywhere),
Expression.Like("LastName", keyword, MatchMode.Anywhere)))
.Add(Expression.Or(
Expression.Like("Email1", keyword, MatchMode.Anywhere),
Expression.Like("Email2", keyword, MatchMode.Anywhere)));
上面的代码生成“Name like %this% or LastName like %this% AND Email1 like %this% and Email2 like %this.
提前致谢。