Esempio n. 1
0
        public virtual Expression Translate(Expression expression)
        {
            Expression expression2 = RelationshipIncluder.Include(this.translator.Mapper, expression);

            if (expression2 != expression)
            {
                expression = expression2;
                expression = UnusedColumnRemover.Remove(expression);
                expression = RedundantColumnRemover.Remove(expression);
                expression = RedundantSubqueryRemover.Remove(expression);
                expression = RedundantJoinRemover.Remove(expression);
            }
            expression2 = SingletonProjectionRewriter.Rewrite(this.translator.Linguist.Language, expression);
            if (expression2 != expression)
            {
                expression = expression2;
                expression = UnusedColumnRemover.Remove(expression);
                expression = RedundantColumnRemover.Remove(expression);
                expression = RedundantSubqueryRemover.Remove(expression);
                expression = RedundantJoinRemover.Remove(expression);
            }
            expression2 = ClientJoinedProjectionRewriter.Rewrite(this.policy, this.translator.Linguist.Language, expression);
            if (expression2 != expression)
            {
                expression = expression2;
                expression = UnusedColumnRemover.Remove(expression);
                expression = RedundantColumnRemover.Remove(expression);
                expression = RedundantSubqueryRemover.Remove(expression);
                expression = RedundantJoinRemover.Remove(expression);
            }
            return(expression);
        }
        public virtual Expression Translate(Expression expression)
        {
            expression = UnusedColumnRemover.Remove(expression);
            expression = RedundantColumnRemover.Remove(expression);
            expression = RedundantSubqueryRemover.Remove(expression);
            Expression expression2 = CrossJoinRewriter.Rewrite(CrossApplyRewriter.Rewrite(this.language, expression));

            if (expression2 != expression)
            {
                expression = expression2;
                expression = UnusedColumnRemover.Remove(expression);
                expression = RedundantSubqueryRemover.Remove(expression);
                expression = RedundantJoinRemover.Remove(expression);
                expression = RedundantColumnRemover.Remove(expression);
            }
            return(expression);
        }
Esempio n. 3
0
        public virtual Expression Translate(Expression expression)
        {
            expression = QueryBinder.Bind(this, expression);
            expression = AggregateRewriter.Rewrite(this.Translator.Linguist.Language, expression);
            expression = UnusedColumnRemover.Remove(expression);
            expression = RedundantColumnRemover.Remove(expression);
            expression = RedundantSubqueryRemover.Remove(expression);
            expression = RedundantJoinRemover.Remove(expression);
            Expression expression2 = RelationshipBinder.Bind(this, expression);

            if (expression2 != expression)
            {
                expression = expression2;
                expression = RedundantColumnRemover.Remove(expression);
                expression = RedundantJoinRemover.Remove(expression);
            }
            expression = ComparisonRewriter.Rewrite(this.Mapping, expression);
            return(expression);
        }