Inheritance: SqlAliasedExpression
Exemplo n.º 1
0
 protected override Expression VisitUnion(SqlUnionExpression expression)
 {
     this.hashCode ^= expression.UnionAll ? 1234145998 : 0;
     this.hashCode ^= expression.Alias?.GetHashCode() ?? 0;
     return(base.VisitUnion(expression));
 }
 protected override Expression VisitUnion(SqlUnionExpression expression)
 {
     this.hashCode ^= expression.UnionAll ? 1234145998 : 0;
     this.hashCode ^= expression.Alias?.GetHashCode() ?? 0;
     return base.VisitUnion(expression);
 }
        protected override Expression VisitUnion(SqlUnionExpression expression)
        {
            SqlUnionExpression current;
            if (!TryGetCurrent(expression, out current))
            {
                return expression;
            }

            if (!(this.result &= current.UnionAll == expression.UnionAll))
            {
                return expression;
            }

            if (!(this.result &= current.NodeType == expression.NodeType))
            {
                return expression;
            }

            if (!(this.result &= object.Equals(current.Alias, expression.Alias)))
            {
                return expression;
            }

            if (!(this.result &= current.Type == expression.Type))
            {
                return expression;
            }

            this.currentObject = current.Left;
            this.Visit(expression.Left);
            if (!this.result)
            {
                return expression;
            }

            this.currentObject = current.Right;
            this.Visit(expression.Right);
            if (!this.result)
            {
                return expression;
            }

            this.currentObject = current.Aliases;
            this.VisitObjectList(expression.Aliases);
            if (!this.result)
            {
                return expression;
            }

            this.currentObject = current;
            return expression;
        }
Exemplo n.º 4
0
		protected virtual Expression VisitUnion(SqlUnionExpression expression)
		{
			var left = this.Visit(expression.Left);
			var right = this.Visit(expression.Right);

			if (left != expression.Left || right != expression.Right)
			{
				return new SqlUnionExpression(expression.Type, expression.Alias, left, right, expression.UnionAll);
			}

			return expression;
		}
Exemplo n.º 5
0
		protected override Expression VisitUnion(SqlUnionExpression union)
		{
			return union;
		}
Exemplo n.º 6
0
		protected override Expression VisitUnion(SqlUnionExpression expression)
		{
			var savedSelectNext = this.selectNest;
			this.selectNest = 0;

			this.Write("(");
			this.Visit(expression.Left);
			if (expression.UnionAll)
			{
				this.Write(" UNION ALL ");
			}
			else
			{
				this.Write(" UNION ");
			}
			this.Visit(expression.Right);
			this.Write(")");
			this.Write(" AS ");
			this.WriteQuotedIdentifier(expression.Alias);

			this.selectNest = savedSelectNext;

			return expression;
		}