@@ -161,14 +161,14 @@ protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior)
161
161
}
162
162
163
163
public override Task < int > ExecuteNonQueryAsync ( CancellationToken cancellationToken ) =>
164
- ExecuteNonQueryAsync ( Connection . AsyncIOBehavior , cancellationToken ) ;
164
+ ExecuteNonQueryAsync ( AsyncIOBehavior , cancellationToken ) ;
165
165
166
166
internal Task < int > ExecuteNonQueryAsync ( IOBehavior ioBehavior , CancellationToken cancellationToken ) =>
167
167
! IsValid ( out var exception ) ? Utility . TaskFromException < int > ( exception ) :
168
168
m_commandExecutor . ExecuteNonQueryAsync ( CommandText , m_parameterCollection , ioBehavior , cancellationToken ) ;
169
169
170
170
public override Task < object > ExecuteScalarAsync ( CancellationToken cancellationToken ) =>
171
- ExecuteScalarAsync ( Connection . AsyncIOBehavior , cancellationToken ) ;
171
+ ExecuteScalarAsync ( AsyncIOBehavior , cancellationToken ) ;
172
172
173
173
internal Task < object > ExecuteScalarAsync ( IOBehavior ioBehavior , CancellationToken cancellationToken ) =>
174
174
! IsValid ( out var exception ) ? Utility . TaskFromException < object > ( exception ) :
@@ -177,7 +177,7 @@ internal Task<object> ExecuteScalarAsync(IOBehavior ioBehavior, CancellationToke
177
177
protected override Task < DbDataReader > ExecuteDbDataReaderAsync ( CommandBehavior behavior , CancellationToken cancellationToken )
178
178
{
179
179
ResetCommandTimeout ( ) ;
180
- return ExecuteReaderAsync ( behavior , Connection . AsyncIOBehavior , cancellationToken ) ;
180
+ return ExecuteReaderAsync ( behavior , AsyncIOBehavior , cancellationToken ) ;
181
181
}
182
182
183
183
internal Task < DbDataReader > ExecuteReaderAsync ( CommandBehavior behavior , IOBehavior ioBehavior , CancellationToken cancellationToken ) =>
@@ -234,6 +234,8 @@ internal void ResetCommandTimeout()
234
234
Connection ? . Session ? . SetTimeout ( commandTimeout == 0 ? Constants . InfiniteTimeout : commandTimeout * 1000 ) ;
235
235
}
236
236
237
+ private IOBehavior AsyncIOBehavior => Connection ? . AsyncIOBehavior ?? IOBehavior . Asynchronous ;
238
+
237
239
private void VerifyNotDisposed ( )
238
240
{
239
241
if ( m_parameterCollection == null )
0 commit comments