Exemple #1
0
        /// <summary>
        ///     Adds CTE to the statement.
        /// </summary>
        public SqlSelectStatementBuilder CTE([NotNull] SqlSelectStatementBuilder statement, [NotNull] string name = "X")
        {
            if (statement == null)
            {
                throw new ArgumentNullException("statement");
            }

            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            var cte = SqlClauseBuilder.CTE(name, statement.Build());

            this.Prefix.Add(cte);

            return(this);
        }
Exemple #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="SqlSelectStatementBuilder" /> class.
 /// </summary>
 public SqlSelectStatementBuilder([NotNull] string tableName)
 {
     this.select = SqlClauseBuilder.Select();
     this.from   = SqlClauseBuilder.From(tableName);
 }