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

Groups #46

Open
madben2000 opened this issue Mar 29, 2019 · 2 comments
Open

Groups #46

madben2000 opened this issue Mar 29, 2019 · 2 comments
Labels

Comments

@madben2000
Copy link

madben2000 commented Mar 29, 2019

Hey,

there only exists StartGroup() function. How to end a group? How do you build following statement:

a=5 or (a=8 and (b=5 or c=7)) or d=1

Thanks

@dbelmont
Copy link
Owner

dbelmont commented Apr 3, 2019

Hi @madben2000,

The EndGroup() doesn't exist because each group is automatically closed upon starting a new one, you just need to move all groups to the end of your expression. And, by the way, there is also no need to use StartGroup() for the very first group because it's automatically created as well. In that sense, your proposed expression should look something like this:

var filter = new Filter<MyType>();
filter.By("a", Operation.EqualTo, 5);
filter.By("d", Operation.EqualTo, 1);
filter.StartGroup();
filter.By("a", Operation.EqualTo, 8);
filter.StartGroup();
filter.By("b", Operation.EqualTo, 5, Connector.Or);
filter.By("c", Operation.EqualTo, 7);

I would ask you to please let me know if that works for you as I wrote the above snippet off the top of my head and didn't test it.

Cheers,
David

@madben2000 madben2000 mentioned this issue May 8, 2019
@madben2000
Copy link
Author

madben2000 commented May 8, 2019

Sorry for my late response. Yes for my expression this would be possible. But what about

(A=1 || (B=2 && F=5)) && (C=3 || D=4)

as asked in #49? I have no idea how to create muliple non-nested groups like

(Group1) && (Group2)...

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

No branches or pull requests

2 participants