CodeInsiders.SharpQL.Predicate.operator C# (CSharp) Method

operator() public static method

public static operator ( ) : Predicate
return Predicate
        public static Predicate operator &(Predicate leftOperand, Predicate rightOperand)
        {
            bool leftIsTrue = leftOperand is TruePredicate;
            bool rightIsTrue = rightOperand is TruePredicate;

            if (leftIsTrue && rightIsTrue) {
                return new TruePredicate();
            }

            if (leftIsTrue || rightIsTrue) {
                return leftIsTrue ? rightOperand : leftOperand;
            }

            return new AndConditionalOperatorAndPredicate(leftOperand, rightOperand);
        }