4
4
5
5
#if NET6_0_OR_GREATER
6
6
7
-
8
7
using System . Collections . Generic ;
9
8
using System . Data ;
10
9
using System . Data . Common ;
@@ -33,7 +32,7 @@ public SqlBatch(SqlConnection connection = null, SqlTransaction transaction = nu
33
32
Connection = connection ;
34
33
Transaction = transaction ;
35
34
}
36
- /// <include file='../../../../../../doc/snippets/Microsoft. Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ Timeout/*' />
35
+ /// <inheritdoc cref="System. Data.Common.DbBatch. Timeout" />
37
36
public override int Timeout
38
37
{
39
38
get
@@ -47,11 +46,11 @@ public override int Timeout
47
46
_batchCommand . CommandTimeout = value ;
48
47
}
49
48
}
50
- /// <include file='../../../../../../doc/snippets/Microsoft. Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ DbBatchCommands/*' />
49
+ /// <inheritdoc cref="System. Data.Common.DbBatch. DbBatchCommands" />
51
50
protected override DbBatchCommandCollection DbBatchCommands => BatchCommands ;
52
51
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/BatchCommands/*'/>
53
52
public new SqlBatchCommandCollection BatchCommands => _providerCommands != null ? _providerCommands : _providerCommands = new SqlBatchCommandCollection ( Commands ) ; // Commands call will check disposed
54
- /// <include file='../../../../../../doc/snippets/Microsoft. Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ DbConnection/*' />
53
+ /// <inheritdoc cref="System. Data.Common.DbBatch. DbConnection" />
55
54
protected override DbConnection DbConnection
56
55
{
57
56
get
@@ -65,7 +64,7 @@ protected override DbConnection DbConnection
65
64
Connection = ( SqlConnection ) value ;
66
65
}
67
66
}
68
- /// <include file='../../../../../../doc/snippets/Microsoft. Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ DbTransaction/*' />
67
+ /// <inheritdoc cref="System. Data.Common.DbBatch. DbTransaction" />
69
68
protected override DbTransaction DbTransaction
70
69
{
71
70
get
@@ -79,46 +78,46 @@ protected override DbTransaction DbTransaction
79
78
Transaction = ( SqlTransaction ) value ;
80
79
}
81
80
}
82
- /// <include file='../../../../../../doc/snippets/Microsoft. Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ Cancel/*' />
81
+ /// <inheritdoc cref="System. Data.Common.DbBatch. Cancel" />
83
82
public override void Cancel ( )
84
83
{
85
84
CheckDisposed ( ) ;
86
85
_batchCommand . Cancel ( ) ;
87
86
}
88
- /// <include file='../../../../../../doc/snippets/Microsoft. Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ ExecuteNonQuery/*' />
87
+ /// <inheritdoc cref="System. Data.Common.DbBatch. ExecuteNonQuery" />
89
88
public override int ExecuteNonQuery ( )
90
89
{
91
90
CheckDisposed ( ) ;
92
91
SetupBatchCommandExecute ( ) ;
93
92
return _batchCommand . ExecuteNonQuery ( ) ;
94
93
}
95
- /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteNonQueryAsync/*' />
94
+ /// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteNonQueryAsync(System.Threading.CancellationToken)" />
96
95
public override Task < int > ExecuteNonQueryAsync ( CancellationToken cancellationToken = default )
97
96
{
98
97
CheckDisposed ( ) ;
99
98
SetupBatchCommandExecute ( ) ;
100
99
return _batchCommand . ExecuteNonQueryAsync ( cancellationToken ) ;
101
100
}
102
- /// <include file='../../../../../../doc/snippets/Microsoft. Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ ExecuteScalar/*' />
101
+ /// <inheritdoc cref="System. Data.Common.DbBatch. ExecuteScalar" />
103
102
public override object ExecuteScalar ( )
104
103
{
105
104
CheckDisposed ( ) ;
106
105
SetupBatchCommandExecute ( ) ;
107
106
return _batchCommand . ExecuteScalar ( ) ;
108
107
}
109
- /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteScalarAsync/*' />
108
+ /// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteScalarAsync(System.Threading.CancellationToken)" />
110
109
public override Task < object > ExecuteScalarAsync ( CancellationToken cancellationToken = default )
111
110
{
112
111
CheckDisposed ( ) ;
113
112
SetupBatchCommandExecute ( ) ;
114
113
return _batchCommand . ExecuteScalarBatchAsync ( cancellationToken ) ;
115
114
}
116
- /// <include file='../../../../../../doc/snippets/Microsoft. Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ Prepare/*' />
115
+ /// <inheritdoc cref="System. Data.Common.DbBatch. Prepare" />
117
116
public override void Prepare ( )
118
117
{
119
118
CheckDisposed ( ) ;
120
119
}
121
- /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/PrepareAsync/*' />
120
+ /// <inheritdoc cref="System.Data.Common.DbBatch.PrepareAsync(System.Threading.CancellationToken)" />
122
121
public override Task PrepareAsync ( CancellationToken cancellationToken = default )
123
122
{
124
123
CheckDisposed ( ) ;
@@ -183,9 +182,7 @@ public SqlDataReader ExecuteReader()
183
182
CheckDisposed ( ) ;
184
183
SetupBatchCommandExecute ( ) ;
185
184
return _batchCommand . ExecuteReaderAsync ( cancellationToken ) ;
186
- }
187
-
188
-
185
+ }
189
186
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteDbDataReader(System.Data.CommandBehavior)"/>
190
187
protected override DbDataReader ExecuteDbDataReader ( CommandBehavior behavior ) => ExecuteReader ( ) ;
191
188
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteDbDataReaderAsync(System.Data.CommandBehavior, System.Threading.CancellationToken)"/>
@@ -207,21 +204,18 @@ protected override Task<DbDataReader> ExecuteDbDataReaderAsync(CommandBehavior b
207
204
TaskScheduler . Default
208
205
) ;
209
206
}
210
-
211
- /// <inheritdoc />
207
+ /// <inheritdoc cref="System.Data.Common.DbBatch.CreateDbBatchCommand"/>
212
208
protected override DbBatchCommand CreateDbBatchCommand ( )
213
209
{
214
210
return new SqlBatchCommand ( ) ;
215
211
}
216
-
217
212
private void CheckDisposed ( )
218
213
{
219
214
if ( _batchCommand is null )
220
215
{
221
216
throw ADP . ObjectDisposed ( this ) ;
222
217
}
223
218
}
224
-
225
219
private void SetupBatchCommandExecute ( )
226
220
{
227
221
SqlConnection connection = Connection ;
0 commit comments