Composing Expression> predicates

c# entity-framework extension-methods iqueryable lambda

Question

I have a method that returns an

Expression<Func<T, bool>> 

When I use this as a predicate in a where clause in EF this works fine, until I try to add more items to the predicate with Expression.Or() I run into the following exception:

The parameter 'xxx' was not bound in the specified LINQ to Entities query expression.

Is there some way around this? What causes this exactly?

SOLVED

using http://blogs.msdn.com/b/meek/archive/2008/05/02/linq-to-entities-combining-predicates.aspx

1
2
3/20/2013 1:05:20 PM

Popular Answer

To compose OR like AND you can use PredicateBuilder

2
3/20/2013 9:42:24 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow