dbelmont / ExpressionBuilder

A library that provides a simple way to create lambda expressions to filter lists and database queries.
Apache License 2.0
372 stars 105 forks source link

Pass expression to filter.By method #33

Closed MaklaCof closed 5 years ago

MaklaCof commented 6 years ago

Hi! Is it possible to use expression for filtering.

Something like that:

var filter = new Filter<DbMyEntity>();
filter.By("Field3", Operation.IsNotNull);
filter.By(t => !t.Field1.HasValue || t.Field1.HasValue && array.Contains(t.Field1.Value), Connector.Or);
filter.By("Field2", Operation.IsEmpty);

That would be super awesome.

dbelmont commented 5 years ago

Hi @MaklaCof, Sorry for the late reply. That's currently not supported. So, what would exactly be the use for this? Why do you need to use the filter in those two different ways? Cheers.

MaklaCof commented 5 years ago

I can't remember. Sorry. I moved on with LINQ Dynamic.