Пример #1
0
        public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel)
        {
            var joins = LeftJoinDetector.Detect(selectClause.Selector, new NameGenerator(queryModel), _sessionFactory);

            if (joins.Joins.Count > 0)
            {
                selectClause.Selector = joins.Selector;

                queryModel.TransformExpressions(e => ExpressionSwapper.Swap(e, joins.ExpressionMap));

                foreach (var join in joins.Joins)
                {
                    queryModel.BodyClauses.Add(join);
                }
            }
        }
Пример #2
0
        public static Expression Swap(Expression expression, Dictionary<Expression, Expression> expressionMap)
        {
            var swapper = new ExpressionSwapper(expressionMap);

            return swapper.VisitExpression(expression);
        }
Пример #3
0
        public static Expression Swap(Expression expression, Dictionary <Expression, Expression> expressionMap)
        {
            var swapper = new ExpressionSwapper(expressionMap);

            return(swapper.VisitExpression(expression));
        }