IQueryable.Where() suitable Expression in where?

后端 未结 4 1292
自闭症患者
自闭症患者 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 02:54

    you might want to take a wee look at the Predicatebuilder:

    http://www.albahari.com/nutshell/predicatebuilder.aspx

    the Predicatebuilder allows you to run up some very powerful expressions (AND/OR/NOT etc, etc) in a very clean and easy to understand way. For simple expressions, I do of course just roll them from scratch and apply but for the complex stuff...

    I'm quite a fan of it :)

    a few links on SO itself that may be helpful:

    LINQ to SQL PredicateBuilder

    Generated SQL with PredicateBuilder, LINQPad and operator ANY

提交回复
热议问题