public SqlQueryExpression()
     : base(SqlExpressionType.Query)
 {
     From    = new SqlQueryExpressionFrom();
     GroupBy = new List <SqlExpression>();
     Items   = new ItemList();
 }
        public override SqlQueryExpressionFrom VisitQueryFrom(SqlQueryExpressionFrom @from)
        {
            var result = @from;

            if (result != null)
            {
                result = result.Prepare(preparer);
            }

            return(result);
        }
Example #3
0
        public virtual SqlQueryExpressionFrom VisitQueryFrom(SqlQueryExpressionFrom from)
        {
            var result = new SqlQueryExpressionFrom();

            var sources = from.Sources.ToList();

            for (int i = 0; i < sources.Count; i++)
            {
                result.Source(VisitQuerySource(sources[i]));

                if (i > 0 && !from.IsNaturalJoin)
                {
                    var part = VisitJoinPart(from.GetJoinPart(i - 1));
                    result.Join(part.JoinType, part.OnExpression);
                }
            }

            return(result);
        }