コード例 #1
0
            public CaseWhenPair VisitChildren(ExpressionTreeVisitor visitor)
            {
                var newWhen = visitor.VisitExpression(_when);
                var newThen = visitor.VisitExpression(_then);

                return(Update(newWhen, newThen));
            }
コード例 #2
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newField = (LuceneQueryFieldExpression)visitor.VisitExpression(field);
            var newLower = visitor.VisitExpression(lower);
            var newUpper = visitor.VisitExpression(upper);

            return((newField == field && newLower == lower && newUpper == upper) ? this :
                   new LuceneRangeQueryExpression(newField, newLower, lowerQueryType, newUpper, upperQueryType, occur));
        }
コード例 #3
0
 private void GenerateSqlForPrefixOperator(string sqlOperatorString, Expression left, Expression right)
 {
     _commandBuilder.Append(sqlOperatorString);
     _commandBuilder.Append(" (");
     _expressionVisitor.VisitExpression(left);
     _commandBuilder.Append(", ");
     _expressionVisitor.VisitExpression(right);
     _commandBuilder.Append(")");
 }
コード例 #4
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newMatchExpression   = visitor.VisitExpression(Match);
            var newPatternExpression = visitor.VisitExpression(Pattern);

            return(newMatchExpression != Match ||
                   newPatternExpression != Pattern
                ? new LikeExpression(newMatchExpression, newPatternExpression)
                : this);
        }
コード例 #5
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newField   = (LuceneQueryFieldExpression)visitor.VisitExpression(QueryField);
            var newPattern = visitor.VisitExpression(QueryPattern);

            return((newPattern == QueryPattern && newField == QueryField) ? this : new LuceneQueryPredicateExpression(newField, newPattern, Occur)
            {
                AllowSpecialCharacters = AllowSpecialCharacters
            });
        }
コード例 #6
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newLeftExpression   = visitor.VisitExpression(_left);
            var newRightExpression  = visitor.VisitExpression(_right);
            var newEscapeExpression = visitor.VisitExpression(_escapeExpression);

            if (newLeftExpression != _left || newRightExpression != _right || newEscapeExpression != _escapeExpression)
            {
                return(new SqlLikeExpression(newLeftExpression, newRightExpression, newEscapeExpression));
            }
            return(this);
        }
コード例 #7
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newLeftExpression  = visitor.VisitExpression(_leftExpression);
            var newRightExpression = visitor.VisitExpression(_rightExpression);

            if (newLeftExpression != _leftExpression || newRightExpression != _rightExpression)
            {
                return(new SqlInExpression(newLeftExpression, newRightExpression));
            }
            else
            {
                return(this);
            }
        }
コード例 #8
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newCases    = visitor.VisitList(_cases, p => p.VisitChildren(visitor));
            var newElseCase = _elseCase != null?visitor.VisitExpression(_elseCase) : null;

            return(Update(newCases, newElseCase));
        }
コード例 #9
0
ファイル: NhNewExpression.cs プロジェクト: Cary123/NHibernate
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newExpression = visitor.VisitExpression(Expression);

            return(newExpression != Expression
                                           ? new NhStarExpression(newExpression)
                                           : this);
        }
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newPredicate = visitor.VisitExpression(_predicate);

            return(_predicate != newPredicate
                ? new DiscriminatorPredicateExpression(newPredicate, QuerySource)
                : this);
        }
コード例 #11
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newExpression = visitor.VisitExpression(_operand);

            return(newExpression != _operand
                ? new IsNotNullExpression(newExpression)
                : this);
        }
コード例 #12
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            ArgumentUtility.CheckNotNull("visitor", visitor);

            var newKeyExpression     = visitor.VisitExpression(KeyExpression);
            var newElementExpression = visitor.VisitExpression(ElementExpression);

            var originalAggregationExpressions = AggregationExpressions;
            var newAggregationExpressions      = visitor.VisitAndConvert(originalAggregationExpressions, "VisitChildren");

            if (newKeyExpression != KeyExpression ||
                newElementExpression != ElementExpression ||
                newAggregationExpressions != originalAggregationExpressions)
            {
                var newSqlGroupingSelectExpression = new SqlGroupingSelectExpression(newKeyExpression, newElementExpression, newAggregationExpressions);
                return(newSqlGroupingSelectExpression);
            }
            return(this);
        }
コード例 #13
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newExpression = visitor.VisitExpression(BinaryExpression);

            if (ReferenceEquals(BinaryExpression, newExpression))
            {
                return(this);
            }

            return(new BoostBinaryExpression((BinaryExpression)newExpression, Boost));
        }
コード例 #14
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newExpression = visitor.VisitExpression(_expression);

            if (newExpression != _expression)
            {
                return(new SqlConvertedBooleanExpression(newExpression));
            }

            return(this);
        }
コード例 #15
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newPattern = visitor.VisitExpression(pattern);

            if (Equals(pattern, newPattern))
            {
                return(this);
            }

            return(new AllowSpecialCharactersExpression(newPattern));
        }
コード例 #16
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var result = visitor.VisitExpression(_expression);

            if (result != _expression)
            {
                return(new TestExtensionExpression(result));
            }

            return(this);
        }
コード例 #17
0
        public override void VisitWhereClause(Remotion.Linq.Clauses.WhereClause whereClause, QueryModel queryModel, int index)
        {
            bool alreadyHasQuery = false;

            var query = new StringBuilder();
            queries.Add(query);

            ExpressionTreeVisitor visitor = new ExpressionTreeVisitor(query);
            visitor.VisitExpression(whereClause.Predicate);

            base.VisitWhereClause(whereClause, queryModel, index);
        }
コード例 #18
0
        protected internal override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newExpression = visitor.VisitExpression(_comparison);

            if (newExpression != _comparison)
            {
                return(new VBStringComparisonExpression(newExpression, _textCompare));
            }
            else
            {
                return(this);
            }
        }
コード例 #19
0
        protected internal override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newEvaluatedExpression = visitor.VisitExpression(_evaluatedExpression);

            if (newEvaluatedExpression != _evaluatedExpression)
            {
                return(new PartialEvaluationExceptionExpression(_exception, newEvaluatedExpression));
            }
            else
            {
                return(this);
            }
        }
コード例 #20
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newChild = visitor.VisitExpression(Child);

            if (newChild != Child)
            {
                return(new CustomCompositeExpression(Type, newChild));
            }
            else
            {
                return(this);
            }
        }
コード例 #21
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newSource = visitor.VisitExpression(_source);

            if (newSource != _source)
            {
                return(new SqlConvertExpression(Type, newSource));
            }
            else
            {
                return(this);
            }
        }
コード例 #22
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newExpression = visitor.VisitExpression(_expression);

            if (newExpression != _expression)
            {
                return(new SqlExistsExpression(newExpression));
            }
            else
            {
                return(this);
            }
        }
コード例 #23
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newPrimaryKeyExpression = visitor.VisitExpression(_identityExpression);

            if (newPrimaryKeyExpression != _identityExpression)
            {
                return(new SqlEntityConstantExpression(Type, _value, newPrimaryKeyExpression));
            }
            else
            {
                return(this);
            }
        }
コード例 #24
0
        protected internal override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            ArgumentUtility.CheckNotNull("visitor", visitor);

            var newExpression = visitor.VisitExpression(_comparison);

            if (newExpression != _comparison)
            {
                return(new VBStringComparisonExpression(newExpression, _textCompare));
            }
            else
            {
                return(this);
            }
        }
コード例 #25
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            ArgumentUtility.CheckNotNull("visitor", visitor);

            var newExpression = visitor.VisitExpression(_expression);

            if (newExpression != _expression)
            {
                return(new SqlLengthExpression(newExpression));
            }
            else
            {
                return(this);
            }
        }
コード例 #26
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            CheckNotNull("visitor", visitor);

            var newExpression = visitor.VisitExpression(_expression);

            if (newExpression != _expression)
            {
                return(new NamedExpression(_name, newExpression));
            }
            else
            {
                return(this);
            }
        }
        protected internal override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            ArgumentUtility.CheckNotNull("visitor", visitor);

            var newEvaluatedExpression = visitor.VisitExpression(_evaluatedExpression);

            if (newEvaluatedExpression != _evaluatedExpression)
            {
                return(new PartialEvaluationExceptionExpression(_exception, newEvaluatedExpression));
            }
            else
            {
                return(this);
            }
        }
コード例 #28
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            ArgumentUtility.CheckNotNull("visitor", visitor);

            var newExpression = visitor.VisitExpression(_expression);

            if (newExpression != _expression)
            {
                return(new AggregationExpression(Type, newExpression, _aggregationModifier));
            }
            else
            {
                return(this);
            }
        }
コード例 #29
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            ArgumentUtility.CheckNotNull("visitor", visitor);

            var newOrderings = Orderings.Select(
                o =>
            {
                var newExpression = visitor.VisitExpression(o.Expression);
                return(newExpression != o.Expression ? new Ordering(newExpression, o.OrderingDirection) : o);
            }).ToArray();

            if (!newOrderings.SequenceEqual(Orderings))
            {
                return(new SqlRowNumberExpression(newOrderings));
            }
            else
            {
                return(this);
            }
        }
コード例 #30
0
        protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
        {
            var newInnerExpression = visitor.VisitExpression(_expression);

            return(newInnerExpression != _expression ? new AliasExpression(Alias, newInnerExpression) : this);
        }
コード例 #31
0
 protected internal override Expression VisitChildren(ExpressionTreeVisitor visitor)
 {
     ArgumentUtility.CheckNotNull("visitor", visitor);
     return(visitor.VisitExpression(this));
 }