Ejemplo n.º 1
0
        IEnumerator <T> IEnumerable <T> .GetEnumerator()
        {
            var queryBuilder = new BaseQueryBuilder <T>(queryProvider.Connection);
            var from         = queryBuilder.ParseExpression(Expression, ParseOptions.RegisterTables);
            var select       = new Select(queryBuilder.ParseSelectedColumn(queryBuilder.DefaultTable), from);

            select.Accept(queryBuilder.StringBuilder);
            return(queryBuilder.GetEnumerator());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Accepts the specified <paramref name="visitor"/> and dispatches calls to the specific visitor
        /// methods for this object.
        /// </summary>
        /// <param name="visitor">
        /// The <see cref="ISqlVisitor" /> to visit this object with.
        /// </param>
        public override void Accept(ISqlVisitor visitor)
        {
            base.Accept(visitor);

            Select.Accept(visitor);
            From.Accept(visitor);
            Where?.Accept(visitor);
            GroupBy?.Accept(visitor);
            OrderBy.IfAny(orderBy => OrderBy.Accept(visitor));
            Limit?.Accept(visitor);
        }