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

Empty any #71

Closed
h3rmanj opened this issue Jul 8, 2021 · 0 comments · Fixed by #72
Closed

Empty any #71

h3rmanj opened this issue Jul 8, 2021 · 0 comments · Fixed by #72
Labels
bug Something isn't working

Comments

@h3rmanj
Copy link
Contributor

h3rmanj commented Jul 8, 2021

Sometimes you just want to know if a sublist has any, no matter what.

Users?$Filter=Friends/any()

Right now, you have to provide a function to .Any, forcing you to do

.For<User>("Users")
.ByList()
.Filter((u, _, o) => o.Any(u.Friends, f => true))

that generates

Users?$Filter=Friends/any(f:true)

Which technically works (I think), but it would be nice if the 2nd argument func in .Any was optional.

@ZEXSM ZEXSM added the bug Something isn't working label Jul 8, 2021
@ZEXSM ZEXSM linked a pull request Jul 9, 2021 that will close this issue
@ZEXSM ZEXSM closed this as completed in #72 Jul 10, 2021
ZEXSM pushed a commit that referenced this issue Jul 10, 2021
* Optional Any func (#71)

* throw error when func is null, return default if supressed
ZEXSM added a commit that referenced this issue Jul 10, 2021
* add navigation test

* Optional Any func (#72)

* Optional Any func (#71)

* throw error when func is null, return default if supressed

* add support navigation properties

Co-authored-by: Herman Jensen <hjanimations@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants