I’m trying to do something like this, and getting compiler errors:
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);
}
Error:
'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
How can I create a collection of where conditions, and then foreach over them?
So I didn’t figure out how to foreach over a where Condition, but I did figure out how to append to my where condition, and my question in a different way here:
stackoverflow answer
The gist of is that you need to add query.AsExpandable.Where()