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

Can Linq lib generate query for nested AND/or filters? #919

Open
susanhuhu opened this issue Jan 30, 2024 · 0 comments
Open

Can Linq lib generate query for nested AND/or filters? #919

susanhuhu opened this issue Jan 30, 2024 · 0 comments

Comments

@susanhuhu
Copy link

I have code below
DataServiceQuery.DataServiceOrderedQuery)container.Docs.Where(d =>
(d.SourceType == "Commercial" && d.ApplicationName == "all_up")
|| (d.SourceType == "Consumer" && d.ApplicationName == appName));

with Odata clint lib 7.20.0, it generates a query as below
$filter=SourceType eq 'Commercial' and ApplicationName eq 'all_up' or SourceType eq 'Consumer' and ApplicationName eq 'OWA'

It doesn't add () for sub queries so the filter is wrong. How can I workaround this issue please? Or Odata client library doesn't support such nested queries?

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

1 participant