Inheritance: SqlBaseExpression
コード例 #1
0
        protected virtual Expression VisitOrderBy(SqlOrderByExpression orderByExpression)
        {
            var newExpression = this.Visit(orderByExpression.Expression);

            if (newExpression != orderByExpression.Expression)
            {
                return(new SqlOrderByExpression(orderByExpression.OrderType, newExpression));
            }

            return(orderByExpression);
        }
コード例 #2
0
ファイル: SqlExpressionHasher.cs プロジェクト: ciker/Shaolinq
        protected override Expression VisitOrderBy(SqlOrderByExpression orderByExpression)
        {
            if (orderByExpression == null)
            {
                return(null);
            }

            this.hashCode ^= (int)orderByExpression.OrderType;

            this.Visit(orderByExpression.Expression);

            return(base.VisitOrderBy(orderByExpression));
        }
コード例 #3
0
		protected override Expression VisitOrderBy(SqlOrderByExpression orderByExpression)
		{
			base.VisitOrderBy(orderByExpression);

			switch (orderByExpression.OrderType)
			{
			case OrderType.Ascending:
				this.Write(" NULLS FIRST");
				break;
			default:
				this.Write(" NULLS LAST");
				break;
			}

			return orderByExpression;
		}
コード例 #4
0
        protected override Expression VisitOrderBy(SqlOrderByExpression orderByExpression)
        {
            SqlOrderByExpression current;

            if (!TryGetCurrent(orderByExpression, out current))
            {
                return(orderByExpression);
            }

            result = result && (current.OrderType == orderByExpression.OrderType);

            if (result)
            {
                currentObject = current.Expression;
                Visit(orderByExpression.Expression);
                currentObject = current;
            }

            return(orderByExpression);
        }
コード例 #5
0
        protected override Expression VisitOrderBy(SqlOrderByExpression orderByExpression)
        {
            SqlOrderByExpression current;

            if (!this.TryGetCurrent(orderByExpression, out current))
            {
                return(orderByExpression);
            }

            this.result = this.result && (current.OrderType == orderByExpression.OrderType);

            if (this.result)
            {
                this.currentObject = current.Expression;
                this.Visit(orderByExpression.Expression);
                this.currentObject = current;
            }

            return(orderByExpression);
        }
コード例 #6
0
 protected override Expression VisitOrderBy(SqlOrderByExpression expression)
 {
     this.hashCode ^= expression.OrderType.GetHashCode();
     return(base.VisitOrderBy(expression));
 }
コード例 #7
0
 protected override Expression VisitOrderBy(SqlOrderByExpression expression)
 {
     this.hashCode ^= expression.OrderType.GetHashCode();
     return base.VisitOrderBy(expression);
 }
コード例 #8
0
        protected override Expression VisitOrderBy(SqlOrderByExpression expression)
        {
            SqlOrderByExpression current;
            if (!TryGetCurrent(expression, out current))
            {
                return expression;
            }

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

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

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

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

            this.currentObject = current;
            return expression;
        }
コード例 #9
0
		protected virtual Expression VisitOrderBy(SqlOrderByExpression orderByExpression)
		{
			var newExpression = this.Visit(orderByExpression.Expression);

			if (newExpression != orderByExpression.Expression)
			{
				return new SqlOrderByExpression(orderByExpression.OrderType, newExpression);
			}

			return orderByExpression;
		}
コード例 #10
0
		protected override Expression VisitOrderBy(SqlOrderByExpression orderByExpression)
		{
			base.VisitOrderBy(orderByExpression);

			if (((SqlOrderByExpression)orderByExpression).OrderType == OrderType.Descending)
			{
				this.Write(" DESC");
			}

			return orderByExpression;
		}