public override Expression Visit(Expression query)
        {
            query = base.Visit(query);
            query = new ShaperExpressionDedupingExpressionVisitor().Process(query);
            query = new SelectExpressionProjectionApplyingExpressionVisitor().Visit(query);
            query = new SelectExpressionTableAliasUniquifyingExpressionVisitor().Visit(query);
            query = new NullComparisonTransformingExpressionVisitor().Visit(query);

            return(query);
        }
        public override Expression Visit(Expression query)
        {
            query = base.Visit(query);
            query = new ShaperExpressionDedupingExpressionVisitor().Process(query);
            query = new SelectExpressionProjectionApplyingExpressionVisitor().Visit(query);
            query = new SelectExpressionTableAliasUniquifyingExpressionVisitor().Visit(query);

            if (!RelationalOptionsExtension.Extract(_queryCompilationContext.ContextOptions).UseRelationalNulls)
            {
                query = new NullSemanticsRewritingVisitor(SqlExpressionFactory).Visit(query);
            }

            query = new SqlExpressionOptimizingVisitor(SqlExpressionFactory).Visit(query);
            query = new NullComparisonTransformingExpressionVisitor().Visit(query);

            return(query);
        }