Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predicate.extendBinaryPredicateFn missing in latest breeze-client #64

Open
tschettler opened this issue Feb 13, 2022 · 3 comments
Open

Comments

@tschettler
Copy link
Contributor

In 1.x versions of breeze-client, there was a Predicate.extendBinaryPredicateFn method. This has been commented out in the latest version of breeze-client (src/predicate.ts#L201):

  // TODO: determine if/where this is used.
  // static extendBinaryPredicateFn(opMap: IOpMap, visitorFn: any) {

This method was added to breeze.js in version 1.5 (Breeze/breeze.js@89c3e10) by @jtraband.

I was using this method to extend upon the built-in binary predicate operators in breeze. Can this method be restored?

Thanks!

Travis

@steveschmitt
Copy link
Member

Yes! Can you give me an example of how you use it? We have no tests for this right now.

@tschettler
Copy link
Contributor Author

tschettler commented Jan 18, 2023

Sure! I would use it to allow breeze to recognize binary functions available in OData 4. This example would allow the add operator:

Predicate.extendBinaryPredicateFn({'add': { aliases: ['+', 'plus']}});

Which would allow queries like this:
http://host/service/Products?$filter=Price add 2.45 eq 5.00

@steveschmitt
Copy link
Member

I see. Then how would you compose the predicate (where clause)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants