Ejemplo n.º 1
0
 public void Transform(SelectClause selectClause)
 {
     // The select clause typically requires joins for non-Identifier member access
     _requiresJoinForNonIdentifier = true;
     selectClause.TransformExpressions(Visit);
     _requiresJoinForNonIdentifier = false;
 }
Ejemplo n.º 2
0
            public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel)
            {
                var newSelector = _subqueryInjector.Visit(selectClause.Selector);

                selectClause.Selector = newSelector;

                selectClause.TransformExpressions(TransformingVisitor.Visit);
            }
Ejemplo n.º 3
0
        public void TransformExpressions()
        {
            var oldExpression = ExpressionHelper.CreateExpression();
            var newExpression = ExpressionHelper.CreateExpression();
            var clause        = new SelectClause(oldExpression);

            clause.TransformExpressions(ex =>
            {
                Assert.That(ex, Is.SameAs(oldExpression));
                return(newExpression);
            });

            Assert.That(clause.Selector, Is.SameAs(newExpression));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Transforms all the expressions in this <see cref="QueryModel"/>'s clauses via the given <paramref name="transformation"/> delegate.
        /// </summary>
        /// <param name="transformation">The transformation object. This delegate is called for each <see cref="Expression"/> within this
        /// <see cref="QueryModel"/>, and those expressions will be replaced with what the delegate returns.</param>
        public void TransformExpressions(Func <Expression, Expression> transformation)
        {
            MainFromClause.TransformExpressions(transformation);

            foreach (var bodyClause in BodyClauses)
            {
                bodyClause.TransformExpressions(transformation);
            }

            SelectClause.TransformExpressions(transformation);

            foreach (var resultOperator in ResultOperators)
            {
                resultOperator.TransformExpressions(transformation);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Transforms all the expressions in this <see cref="QueryModel"/>'s clauses via the given <paramref name="transformation"/> delegate.
        /// </summary>
        /// <param name="transformation">The transformation object. This delegate is called for each <see cref="Expression"/> within this
        /// <see cref="QueryModel"/>, and those expressions will be replaced with what the delegate returns.</param>
        public void TransformExpressions(Func <Expression, Expression> transformation)
        {
            ArgumentUtility.CheckNotNull("transformation", transformation);

            MainFromClause.TransformExpressions(transformation);

            foreach (var bodyClause in BodyClauses)
            {
                bodyClause.TransformExpressions(transformation);
            }

            SelectClause.TransformExpressions(transformation);

            foreach (var resultOperator in ResultOperators)
            {
                resultOperator.TransformExpressions(transformation);
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
 ///     directly from your code. This API may change or be removed in future releases.
 /// </summary>
 public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel)
 => selectClause.TransformExpressions(TransformingVisitor.Visit);
Ejemplo n.º 7
0
 public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel)
 {
     selectClause.TransformExpressions(e => MergeAggregatingResultsInExpressionRewriter.Rewrite(e, new NameGenerator(queryModel)));
 }
		public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel)
		{
            selectClause.TransformExpressions(MergeAggregatingResultsInExpressionRewriter.Rewrite);
		}
		public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel)
		{
            selectClause.TransformExpressions(e => MergeAggregatingResultsInExpressionRewriter.Rewrite(e, new NameGenerator(queryModel)));
		}
Ejemplo n.º 10
0
 public void Transform(SelectClause selectClause)
 {
     selectClause.TransformExpressions(VisitExpression);
 }
Ejemplo n.º 11
0
 public void Transform(SelectClause selectClause)
 {
     _requiresJoinForNonIdentifier = true;
     selectClause.TransformExpressions(VisitExpression);
     _requiresJoinForNonIdentifier = false;
 }
 public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel)
 {
     selectClause.TransformExpressions(_innerVisitor.Visit);
 }