Predicate build with NET Core and EF Core

后端 未结 2 1323
[愿得一人]
[愿得一人] 2021-01-13 11:18

Very quick question :

I\'m trying to create a predicate builder like this :

    var predicate = PredicateBuilder.False();

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-13 11:44

    Here is also a solution, it can parse a string expression to lambda expression like this

    Expression> predicate 
        = Interpreter.ParsePredicate("id = 1 and name='Test'").Result;
    

    Refer to https://github.com/linhnle/Kkts.Expressions

提交回复
热议问题