Exemplo n.º 1
0
        /// Closes the subquery parts aggregator and adds a subquery as a part of this query.
        ///
        /// If a subquery parts aggregator is open and is also visiting a subquery,
        /// redirects the call to it instead.
        public void CloseSubQueryExpressionPartsAggregator()
        {
            if (_visitingSubQueryExpression && _subQueryExpressionPartsAggregator._visitingSubQueryExpression)
            {
                _subQueryExpressionPartsAggregator.CloseSubQueryExpressionPartsAggregator();
            }
            else
            {
                if (string.IsNullOrEmpty(SelectPart))
                {
                    SelectPart = _subQueryExpressionPartsAggregator.SelectPart;
                }
                else
                {
                    SubQueries.Add(_subQueryExpressionPartsAggregator.BuildQueryStatement().Trim(';'));
                }

                _visitingSubQueryExpression = false;
            }
        }
Exemplo n.º 2
0
 /// Returns the generated PostgreSQL query in the form of a raw statement and a dictionary of arguments it uses.
 public QueryCommand GetPsqlCommand()
 {
     return(new QueryCommand(_queryParts.BuildQueryStatement(), _parameterAggregator.Parameters));
 }