public override string ToString()
        {
            if (Left == "_LambdaTree_")
            {
                string str;
                if (!string.IsNullOrWhiteSpace(Alias))
                {
                    str = "[" + Alias + "].";
                }
                else
                {
                    str = "[" + LeftSchema + "].[" + LeftTable + "].";
                }
                return(Right.Replace("_table_Alias_", str ?? ""));
            }
            var    str1 = LocigalOperator == LogicalOperator.NotSet ? string.Empty : LocigalOperator.ToString().ToUpperInvariant();
            string str2;

            if (!string.IsNullOrWhiteSpace(Alias))
            {
                str2 = "[" + Alias + "].[" + Left + "]";
            }
            else
            {
                str2 = "[" + LeftSchema + "].[" + LeftTable + "].[" + Left + "]";
            }
            var str3 = str2;

            return((str1 + " " + str3 + " " + Operator + " " + Right).Trim());
        }
        public override string ToString()
        {
            var op = LocigalOperator == LogicalOperator.NotSet
                ? string.Empty
                : LocigalOperator.ToString().ToUpperInvariant() + " ";
            string schema;

            if (!string.IsNullOrEmpty(Alias))
            {
                schema = "[" + Alias + "]";
            }
            else
            {
                schema = "[" + Schema + "].[" + TableName + "]";
            }
            if (Left == "_LambdaTree_")
            {
                var prefix = schema;
                var split  = LambdaTree.Split(new[] { ExpressionOperator }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var p in ParameterDefinitions)
                {
                    if (p.ExpressionSide == ExpressionSide.Left)
                    {
                        split[0] = p.Params;
                    }
                    else
                    {
                        split[1] = p.Params;
                    }
                }
                var sqlTerm = new StringBuilder(split[0]).Append(ExpressionOperator).Append(split[1]).ToString();
                var s       = new StringBuilder(op).Append(schema).Append(".").Append(sqlTerm);
                return(s.ToString());
            }
            if (Right != "NULL")
            {
                return(op + "(" + schema + ".[" + Left + "] " + Operator + " " + Right + ")");
            }
            switch (Operator)
            {
            case "=":
                Operator = "IS";
                break;

            case "<>":
                Operator = "IS NOT";
                break;
            }

            return(op + "(" + schema + ".[" + Left + "] " + Operator + " " + Right + ")");
        }
示例#3
0
        public override string ToString()
        {
            var str1 = LocigalOperator == LogicalOperator.NotSet
                ? string.Empty
                : LocigalOperator.ToString().ToUpperInvariant() + " ";
            string str2;

            if (!string.IsNullOrEmpty(Alias))
            {
                str2 = "[" + Alias + "]";
            }
            else
            {
                str2 = "[" + Schema + "].[" + TableName + "]";
            }
            var str3 = str2;

            if (Left == "_LambdaTree_")
            {
                return(str1 + LambdaTree.Replace("_table_Alias_", str3 + "."));
            }
            if (Right != "NULL")
            {
                return(str1 + str3 + ".[" + Left + "] " + Operator + " " + Right);
            }
            switch (Operator)
            {
            case "=":
                Operator = "IS";
                break;

            case "<>":
                Operator = "IS NOT";
                break;
            }

            return(str1 + str3 + ".[" + Left + "] " + Operator + " " + Right);
        }