OzCode is introducing a new feature in version 3.5: Conditional Search.
The regular search is great to search for text in expression properties and members, and it’s been recently radically improved. But, what if you want to search based on some kind of logical condition? For example, searching for customers with age between 25 to 30. Or, searching for companies with over 20% income increase? You’ll need some kind of predicate for that purpose, sort like you would use in LINQ Where clause.
This is exactly what Conditional Search is about! We are now allowing you to search a collection, according to custom logic.
How it works
First, hover over a collection object (any IEnumerable will work):
You’ll see a combo box appear with search mode. When choosing Condition, you will be able to enter a predicate into the search field, which will run on each member of the collection.
In this example, the search is a match for each customer whose BloodType starts with “A”.
On the Predicate
The Predicate can be any C# expression that returns a bool, when hovering over IEnumerable<T>. You can include logical expressions and whatever complicated logic crossed your mind.
For example, if T is a Company, you might write:
[obj].MarketCap > 10000000 && [obj].Eearnings > [obj].Eearnings * 1.25
Everything works, as long as it’s managed code.
Conditional Search in action
When can I have it ???
The Early Access Preview version is already available. It’s pretty stable and we encourage you to download and try, and give us your feedback!.