Linq PredicateBuilder - Multiple ORs

后端 未结 2 375
南方客
南方客 2020-12-09 04:23

I\'m trying to use the PredicateBuilder, as described here - http://www.albahari.com/nutshell/predicatebuilder.aspx

The following code

var predicate          


        
相关标签:
2条回答
  • 2020-12-09 05:16

    Try compiling your predicate:

    var streetList = from street in streetData.Where(predicate.Compile())
                     select street;
    
    0 讨论(0)
  • 2020-12-09 05:21

    Ah; your list is using IEnumerable<T> extension methods (rather than IQueryable<T>) - try:

    var streetList = from street in streetData.AsQueryable().Where(predicate)
                     select street;
    
    0 讨论(0)
提交回复
热议问题