Exemplo n.º 1
0
        ISqlExpression?ISqlExpressionWalkable.Walk(WalkOptions options, Func <ISqlExpression, ISqlExpression> func)
        {
            if (!options.SkipColumnDeclaration)
            {
                for (var i = 0; i < Columns.Count; i++)
                {
                    var col  = Columns[i];
                    var expr = col.Walk(options, func);

                    if (expr is SqlColumn column)
                    {
                        Columns[i] = column;
                    }
                    else
                    {
                        Columns[i] = new SqlColumn(col.Parent, expr, col.Alias);
                    }
                }
            }

            TakeValue = TakeValue?.Walk(options, func);
            SkipValue = SkipValue?.Walk(options, func);

            return(null);
        }
Exemplo n.º 2
0
        IQueryExpression ISqlExpressionWalkable.Walk(bool skipColumns, Func <IQueryExpression, IQueryExpression> func)
        {
            for (var i = 0; i < Columns.Count; i++)
            {
                var col  = Columns[i];
                var expr = col.Walk(skipColumns, func);

                var column = expr as IColumn;
                if (column != null)
                {
                    Columns[i] = column;
                }
                else
                {
                    Columns[i] = new Column(col.Parent, expr, col.Alias);
                }
            }

            TakeValue = TakeValue?.Walk(skipColumns, func);
            SkipValue = SkipValue?.Walk(skipColumns, func);

            return(null);
        }