[英]nested predicates in breeze.js
Is it possible to use some sort of nested predicates in breeze.js? 是否可以在breeze.js中使用某种嵌套谓词?
I want something like (a) and(b or c or d))
我想要类似
(a) and(b or c or d))
I am only able to chain the predicates without the logical brackets with: 我只能用以下逻辑括号将谓词链接起来:
predicates = predicates.and(a);
predicates = predicates.or(b);
predicates = predicates.or(c);
predicates = predicates.or(d);
// predicates not nested: a and b or c or d
You should compose your predicates: 您应该组成谓词:
var leftSide = predicates.or(b).or(c).or(d);
var composedPredicate = leftSide.and(a);
It will give you: 它会给你:
(b or c or d) and a
Edit: 编辑:
Just found a very useful thread: 刚发现一个非常有用的线程:
How do I write a breeze Predicate equivalent to the following SQL 如何编写与以下SQL等效的微风谓词
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.