/// <summary>
        /// Visitor pattern method for <see cref="DbSortExpression"/>.
        /// </summary>
        /// <param name="expression">The DbSortExpression that is being visited.</param>
        /// <exception cref="ArgumentNullException"><paramref name="expression"/> is null</exception>
        public override void Visit(DbSortExpression expression)
        {
            // #433613: PreSharp warning 56506: Parameter 'expression' to this public method must be validated: A null-dereference can occur here.
            EntityUtil.CheckArgumentNull(expression, "expression");

            VisitExpressionBindingPre(expression.Input);
            for (int idx = 0; idx < expression.SortOrder.Count; idx++)
            {
                VisitExpression(expression.SortOrder[idx].Expression);
            }
            VisitExpressionBindingPost(expression.Input);
        }
        public override DbExpression Visit(DbSortExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            DbExpression result = expression;

            DbExpressionBinding  newInput     = this.VisitExpressionBindingEnterScope(expression.Input);
            IList <DbSortClause> newSortOrder = this.VisitSortOrder(expression.SortOrder);

            this.ExitScope();

            if (!object.ReferenceEquals(expression.Input, newInput) ||
                !object.ReferenceEquals(expression.SortOrder, newSortOrder))
            {
                result = CqtBuilder.Sort(newInput, newSortOrder);
            }
            NotifyIfChanged(expression, result);
            return(result);
        }
 /// <summary>
 /// Typed visitor pattern method for DbSortExpression.
 /// </summary>
 /// <param name="expression">The DbSortExpression that is being visited.</param>
 /// <returns>An instance of TResultType.</returns>
 public abstract TResultType Visit(DbSortExpression expression);
Esempio n. 4
0
 /// <summary>
 /// Visitor pattern method for DbSortExpression.
 /// </summary>
 /// <param name="expression">The DbSortExpression that is being visited.</param>
 public abstract void Visit(DbSortExpression expression);