我使用了像Raphael建议的谓词构建器,它只是项目中要包含的一个文件,因此您的示例变为:
var keywords=new List<string>(){ "Test1","Test2" };var predicate = PredicateBuilder.False<QuestionsmetaDatas>();foreach (var key in keywords){ predicate = predicate.Or (a => a.Text.Contains (key));}var query = context.QuestionsmetaDatas.AsQueryable().Where(predicate);生成您正在寻找的OR查询。



