Example #1
0
        public override string ToPhrase(bool ignoreLogical)
        {
            StringBuilder phrase = new StringBuilder();

            if (!ignoreLogical)
            {
                phrase.Append(LogicalOperatorManipulator.GetStringValue(logicalOperator));
                phrase.Append(" ");
            }

            phrase.Append(fieldOperand.ToPhrase());
            phrase.Append(" ");
            phrase.Append(ComparisonOperatorManipulator.GetStringValue(comparisonOperator));
            phrase.Append(" ");
            phrase.Append(sqlValueOperand.ToPhrase());

            return(phrase.ToString());
        }
Example #2
0
        public override string ToPhrase(bool ignoreLogical)
        {
            StringBuilder phrase = new StringBuilder();

            if (!ignoreLogical)
            {
                phrase.Append(LogicalOperatorManipulator.GetStringValue(this.logicalOperator));
                phrase.Append(" ");
            }

            if (ignoreCase)
            {
                phrase.Append(" lower({0}) ");
                phrase.Replace("{0}", this.propertyOperand.ToPhrase());
            }
            else
            {
                phrase.Append(this.propertyOperand.ToPhrase());
            }

            phrase.Append(" ");
            phrase.Append(ComparisonOperatorManipulator.GetStringValue(ComparisonOperator.Like));
            phrase.Append(" ");

            if (ignoreCase)
            {
                phrase.Append(" lower(:{1}) ");
                phrase.Replace("{1}", this.parameterName);
            }
            else
            {
                phrase.Append(":");
                phrase.Append(this.parameterName);
            }

            return(phrase.ToString());
        }