44namespace FluentCommand . Query ;
55
66/// <summary>
7- /// Delete query statement builder
7+ /// Provides a builder for constructing SQL DELETE statements with fluent, chainable methods.
88/// </summary>
99public class DeleteBuilder : DeleteBuilder < DeleteBuilder >
1010{
1111 /// <summary>
1212 /// Initializes a new instance of the <see cref="DeleteBuilder"/> class.
1313 /// </summary>
14- /// <param name="queryGenerator">The query generator .</param>
15- /// <param name="parameters">The parameters .</param>
16- /// <param name="logicalOperator">The logical operator.</param>
14+ /// <param name="queryGenerator">The <see cref="IQueryGenerator"/> used to generate SQL expressions .</param>
15+ /// <param name="parameters">The list of <see cref="QueryParameter"/> objects for the query .</param>
16+ /// <param name="logicalOperator">The logical operator (<see cref="LogicalOperators"/>) to combine WHERE expressions. Defaults to <see cref="LogicalOperators.And"/> .</param>
1717 public DeleteBuilder (
1818 IQueryGenerator queryGenerator ,
1919 List < QueryParameter > parameters ,
@@ -24,18 +24,18 @@ public DeleteBuilder(
2424}
2525
2626/// <summary>
27- /// Delete query statement builder
27+ /// Provides a generic base class for building SQL DELETE statements with fluent, chainable methods.
2828/// </summary>
29- /// <typeparam name="TBuilder">The type of the builder.</typeparam>
29+ /// <typeparam name="TBuilder">The type of the builder for fluent chaining .</typeparam>
3030public abstract class DeleteBuilder < TBuilder > : WhereBuilder < TBuilder >
3131 where TBuilder : DeleteBuilder < TBuilder >
3232{
3333 /// <summary>
3434 /// Initializes a new instance of the <see cref="DeleteBuilder{TBuilder}"/> class.
3535 /// </summary>
36- /// <param name="queryGenerator">The query generator .</param>
37- /// <param name="parameters">The parameters .</param>
38- /// <param name="logicalOperator">The logical operator.</param>
36+ /// <param name="queryGenerator">The <see cref="IQueryGenerator"/> used to generate SQL expressions .</param>
37+ /// <param name="parameters">The list of <see cref="QueryParameter"/> objects for the query .</param>
38+ /// <param name="logicalOperator">The logical operator (<see cref="LogicalOperators"/>) to combine WHERE expressions. Defaults to <see cref="LogicalOperators.And"/> .</param>
3939 protected DeleteBuilder (
4040 IQueryGenerator queryGenerator ,
4141 List < QueryParameter > parameters ,
@@ -44,48 +44,46 @@ protected DeleteBuilder(
4444 {
4545 }
4646
47-
4847 /// <summary>
49- /// Gets the output expressions.
48+ /// Gets the collection of output column expressions for the DELETE statement .
5049 /// </summary>
5150 /// <value>
52- /// The output expressions.
51+ /// A <see cref="HashSet{ColumnExpression}"/> containing the output column expressions.
5352 /// </value>
5453 protected HashSet < ColumnExpression > OutputExpressions { get ; } = new ( ) ;
5554
5655 /// <summary>
57- /// Gets from expressions.
56+ /// Gets the collection of FROM table expressions for the DELETE statement .
5857 /// </summary>
5958 /// <value>
60- /// From expressions.
59+ /// A <see cref="HashSet{TableExpression}"/> containing the FROM table expressions.
6160 /// </value>
6261 protected HashSet < TableExpression > FromExpressions { get ; } = new ( ) ;
6362
6463 /// <summary>
65- /// Gets the join expressions.
64+ /// Gets the collection of JOIN expressions for the DELETE statement .
6665 /// </summary>
6766 /// <value>
68- /// The join expressions.
67+ /// A <see cref="HashSet{JoinExpression}"/> containing the JOIN expressions.
6968 /// </value>
7069 protected HashSet < JoinExpression > JoinExpressions { get ; } = new ( ) ;
7170
7271 /// <summary>
73- /// Gets the table expression.
72+ /// Gets the target table expression for the DELETE statement .
7473 /// </summary>
7574 /// <value>
76- /// The table expression .
75+ /// The <see cref="TableExpression"/> representing the target table .
7776 /// </value>
7877 protected TableExpression TableExpression { get ; private set ; }
7978
80-
8179 /// <summary>
82- /// Set the target table to delete from.
80+ /// Sets the target table to delete from.
8381 /// </summary>
84- /// <param name="tableName">Name of the table.</param>
85- /// <param name="tableSchema">The table schema .</param>
86- /// <param name="tableAlias">The table alias .</param>
82+ /// <param name="tableName">The name of the table.</param>
83+ /// <param name="tableSchema">The schema of the table (optional) .</param>
84+ /// <param name="tableAlias">The alias for the table (optional) .</param>
8785 /// <returns>
88- /// The same builder so that multiple calls can be chained .
86+ /// The same builder instance for method chaining .
8987 /// </returns>
9088 public TBuilder Table (
9189 string tableName ,
@@ -97,15 +95,15 @@ public TBuilder Table(
9795 return ( TBuilder ) this ;
9896 }
9997
100-
10198 /// <summary>
102- /// Add an output clause for the specified column names.
99+ /// Adds an OUTPUT clause for the specified column names.
103100 /// </summary>
104- /// <param name="columnNames">The column names.</param>
105- /// <param name="tableAlias">The table alias .</param>
101+ /// <param name="columnNames">The collection of column names to include in the OUTPUT clause .</param>
102+ /// <param name="tableAlias">The alias for the table (optional) .</param>
106103 /// <returns>
107- /// The same builder so that multiple calls can be chained .
104+ /// The same builder instance for method chaining .
108105 /// </returns>
106+ /// <exception cref="ArgumentNullException">Thrown if <paramref name="columnNames"/> is <c>null</c>.</exception>
109107 public TBuilder Output (
110108 IEnumerable < string > columnNames ,
111109 string tableAlias = null )
@@ -120,13 +118,13 @@ public TBuilder Output(
120118 }
121119
122120 /// <summary>
123- /// Add an output clause for the specified column name.
121+ /// Adds an OUTPUT clause for the specified column name.
124122 /// </summary>
125- /// <param name="columnName">Name of the column.</param>
126- /// <param name="tableAlias">The table alias .</param>
127- /// <param name="columnAlias">The column alias .</param>
123+ /// <param name="columnName">The name of the column to include in the OUTPUT clause .</param>
124+ /// <param name="tableAlias">The alias for the table (optional) .</param>
125+ /// <param name="columnAlias">The alias for the column (optional) .</param>
128126 /// <returns>
129- /// The same builder so that multiple calls can be chained .
127+ /// The same builder instance for method chaining .
130128 /// </returns>
131129 public TBuilder Output (
132130 string columnName ,
@@ -141,14 +139,14 @@ public TBuilder Output(
141139 }
142140
143141 /// <summary>
144- /// Conditionally add an output clause for the specified column name.
142+ /// Conditionally adds an OUTPUT clause for the specified column name if the condition is met .
145143 /// </summary>
146- /// <param name="columnName">Name of the column.</param>
147- /// <param name="tableAlias">The table alias .</param>
148- /// <param name="columnAlias">The column alias .</param>
149- /// <param name="condition">The condition .</param>
144+ /// <param name="columnName">The name of the column to include in the OUTPUT clause .</param>
145+ /// <param name="tableAlias">The alias for the table (optional) .</param>
146+ /// <param name="columnAlias">The alias for the column (optional) .</param>
147+ /// <param name="condition">A function that determines whether to add the OUTPUT clause. If <c>null</c>, the clause is always added .</param>
150148 /// <returns>
151- /// The same builder so that multiple calls can be chained .
149+ /// The same builder instance for method chaining .
152150 /// </returns>
153151 public TBuilder OutputIf (
154152 string columnName ,
@@ -162,15 +160,14 @@ public TBuilder OutputIf(
162160 return Output ( columnName , tableAlias , columnAlias ) ;
163161 }
164162
165-
166163 /// <summary>
167- /// Add a from clause to the query .
164+ /// Adds a FROM clause to the DELETE statement .
168165 /// </summary>
169- /// <param name="tableName">Name of the table.</param>
170- /// <param name="tableSchema">The table schema .</param>
171- /// <param name="tableAlias">The table alias .</param>
166+ /// <param name="tableName">The name of the table to include in the FROM clause .</param>
167+ /// <param name="tableSchema">The schema of the table (optional) .</param>
168+ /// <param name="tableAlias">The alias for the table (optional) .</param>
172169 /// <returns>
173- /// The same builder so that multiple calls can be chained .
170+ /// The same builder instance for method chaining .
174171 /// </returns>
175172 public virtual TBuilder From (
176173 string tableName ,
@@ -185,11 +182,11 @@ public virtual TBuilder From(
185182 }
186183
187184 /// <summary>
188- /// Add a raw from clause to the query .
185+ /// Adds a raw FROM clause to the DELETE statement .
189186 /// </summary>
190- /// <param name="fromClause">From clause.</param>
187+ /// <param name="fromClause">The raw SQL FROM clause.</param>
191188 /// <returns>
192- /// The same builder so that multiple calls can be chained .
189+ /// The same builder instance for method chaining .
193190 /// </returns>
194191 public TBuilder FromRaw ( string fromClause )
195192 {
@@ -200,11 +197,11 @@ public TBuilder FromRaw(string fromClause)
200197 }
201198
202199 /// <summary>
203- /// Add a join clause using the specified builder action
200+ /// Adds a JOIN clause to the DELETE statement using the specified builder action.
204201 /// </summary>
205- /// <param name="builder">The builder .</param>
202+ /// <param name="builder">An action that configures the join using a <see cref="JoinBuilder"/> .</param>
206203 /// <returns>
207- /// The same builder so that multiple calls can be chained .
204+ /// The same builder instance for method chaining .
208205 /// </returns>
209206 public TBuilder Join ( Action < JoinBuilder > builder )
210207 {
@@ -216,7 +213,12 @@ public TBuilder Join(Action<JoinBuilder> builder)
216213 return ( TBuilder ) this ;
217214 }
218215
219- /// <inheritdoc />
216+ /// <summary>
217+ /// Builds the SQL DELETE statement using the current configuration.
218+ /// </summary>
219+ /// <returns>
220+ /// A <see cref="QueryStatement"/> containing the SQL DELETE statement and its parameters.
221+ /// </returns>
220222 public override QueryStatement BuildStatement ( )
221223 {
222224 var deleteStatement = new DeleteStatement (
0 commit comments