我正在尝试创建一种搜索方法,我想检查关键字是否包含在给定记录的任意数量的不同列中。
我的 Linq 语句如下:
string[] searchFilter = {"john", "iceberg"};
var q = from qua in qual
join del in deliverables on qua.ID equals del.Q_ID
where searchFilter.All(s => (qua.Name + " " + qua.Project + " " + qua.Summary + " " + del.Name + " " + del.Summary).ToLower().Contains(s))
select qua;
但是,我收到一条错误消息,其中指出:“本地序列不能用于查询运算符的 LINQ to SQL 实现中,但 Contains() 运算符除外。”