1、先建一个普通的where条件(借助于外部类 PredicateExtensionses)
Expression<Func<CustClueInfo, bool>> where = PredicateExtensionses.True<CustClueInfo>();
2、建一个用于存储or的where条件(这个时候用的是False)
Expression<Func<CustClueInfo, bool>> orFilter = PredicateExtensionses.False<CustClueInfo>();
3、给or条件赋值
foreach (string dept in lstDept) { string strDept = "\" + dept + "\"; orFilter = orFilter.Or(c => c.OwnUserFullPath.Contains(strDept)); }
4、把普通where条件与or条件组合
where = where.And(orFilter);