Nice to have -- create an empty Breeze Predicate
It would be nice if you could create an "empty" breeze predicate. Then if you were adding multiple conditions, you could easily do so in a loop.
For example, you might currently have to do something like this:
var predicate;
entity1.child1.forEach(function (child) {
if (predicate) {
predicate = predicate.or('tableField', ops.Equals, child.keyColumn);
} else {
// create the original predicate
predicate = new breeze.Predicate('tableField', ops.Equals, child.keyColumn);
}
})
but it would be nicer if you could say:
var predicate = new breeze.Predicate();
entity1.child1.forEach(function (child) {
predicate = predicate.or('tableField', ops.Equals, child.keyColumn);
}
})
where Breeze would assume that if the predicate was empty, it would simply add the first expression since there was nothing to OR it with. (or AND it with)
Please sign in to leave a comment.
Comments
0 comments