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

Building the filter #50

Open
MohammedNagar opened this issue May 1, 2019 · 2 comments
Open

Building the filter #50

MohammedNagar opened this issue May 1, 2019 · 2 comments

Comments

@MohammedNagar
Copy link

Thanks a lot for this project, It's so special.

My issue is about (How to use). I'm a little confused, I have read the documentation and the code-project explanation, but I still miss something.

How could I compose the following code from the UI?

var filter = new Filter();
filter.By("Id", Operation.Between, 2, 4, Connector.And);
filter.By("Contacts[Value]", Operation.EndsWith, "@email.com", default(string), Connector.And);
filter.By("Birth.Country", Operation.IsNotNull, default(string), default(string), Connector.Or);
filter.By("Name", Operation.Contains, " John");

I want the end user to build the previous query(filter) first(not me) then converted to equivalent lambda expression after that. I'll be grateful if there's some example to explain this point more.

@aldrashan
Copy link

I'm not entirely sure what you mean.
You want to create filters in your UI and pass them to the backend and convert these to the correct lambda filter?

In our case we use QueryBuilder.
These filter values get posted to the backend and parsed to C# objects.
I then wrote a function that recursively creates the correct lambda filter by converting the parsed filter tree to my needed lambda filter tree.

Either way you're going to need to pass your filters to the backend and write a function that converts them to the query you need by evaluating the passed filter values.

@dmitribodiu
Copy link

I then wrote a function that recursively creates the correct lambda filter by converting the parsed filter tree to my needed lambda filter tree.

@aldrashan Can you point me where is that function located please?

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

3 participants