我正在尝试做这样的事情,并得到编译器错误:
var query = from ev in dataConnection.event_info
where ev.isdeleted == 0
select ev;
foreach (System.Linq.Expressions.Expression whereCond in whereConditionsList)
{
query.Where(whereCond);
}
错误:
'System.Linq.IQueryable<JsonApplicationServices.event_info>' does not contain a definition for 'Where' and the best extension method overload 'System.Linq.Enumerable.Where<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,int,bool>)' has some invalid arguments C:\Users\jzumbrum\perforce_jzumbrum_laptop\jzumbrum_laptop\SlamRun\WCFService\Events.cs 31 21 WCFService
如何创建where
条件集合,然后foreach
对其进行处理?