whereIf method

S whereIf(
  1. bool test,
  2. MssqlCondition predicate(
    1. TFields fields
    )
)

Adds predicate only when test is true.

The callback is not invoked on the false branch, so a UI filter that is off does not accidentally widen a write.

Implementation

S whereIf(bool test, MssqlCondition Function(TFields fields) predicate) {
  if (!test) return _self;
  return where(predicate);
}