@Nad, great point!
categorySelector.isBlank() OR [My Table ].[Category].Contains(categorySelector)
Is an elegant solution. I’d still argue that
someSelector.ifNotBlank(...) is a bit more readable, but I’ll be using your approach until we have that.
@Federico_Stefanato couldn’t we use
Seems to work here.
The only reservation I have about this approach is that I find it more complex to parse at a glance what a condition is doing when it contains many
AND tokens. I suppose with some formatting it’s a bit more readable.
If logical operators could be chained then this might be an interesting pattern. Not sure it’s much more readable but at least operator preference is explicit.