IQueryable.Where() suitable Expression in where?

后端 未结 4 1261
自闭症患者
自闭症患者 2021-01-03 02:05

I\'m very low experienced with Expressions in .NET, that\'s why I rather ask you guys. How should I - see comment below:

using P = Myclass;
..
S         


        
4条回答
  •  别那么骄傲
    2021-01-03 03:01

    Its a combination of two Func on expression level.

    A less fancy way to do the same should be:

    Func myExpression1 = x => foo1 == true && foo2 == false;
    Func myExpression2 = x => ... ;
    
    IQueryable

    l = l.Where((p) => myExpression1(p) || myExpression2(p));

提交回复
热议问题