我想在Linq to Entities中启用此功能(以便过滤发生在SQL Server上)?
public static bool ContainsAny(this string source, StringComparison comparison,
IEnumerable<string> searchTerms)
{
return searchTerms.Any(searchTerm => source.Contains(searchTerm, comparison));
}
我的目标是使用上述函数搜索表格并通过过滤某一列来限制结果,即GetContacts().Where(c => c.FullName.ContainAny(searchTerm))
。
source
应该是IEnumerable<string>
类型? - Douglas