Ejemplo n.º 1
0
        public override Expression VisitExpression(Expression expression)
        {
            var newExpression = base.VisitExpression(expression);

            if (newExpression == null)
            {
                return(newExpression);
            }

            var transformations = _tranformationProvider.GetTransformations(newExpression);

            foreach (var transformation in transformations)
            {
                var transformedExpression = transformation(newExpression);
#if !PORTABLE
                Trace.Assert(transformedExpression != null);
#endif
                if (transformedExpression != newExpression)
                {
                    return(VisitExpression(transformedExpression));
                }
            }

            return(newExpression);
        }
Ejemplo n.º 2
0
        public override Expression VisitExpression(Expression expression)
        {
            var newExpression = base.VisitExpression(expression);

            if (newExpression == null)
            {
                return(newExpression);
            }

            var transformations = _tranformationProvider.GetTransformations(newExpression);

            foreach (var transformation in transformations)
            {
                var transformedExpression = transformation(newExpression);
                Assertion.IsNotNull(transformedExpression);
                if (transformedExpression != newExpression)
                {
                    return(VisitExpression(transformedExpression));
                }
            }

            return(newExpression);
        }