@@ -35,7 +35,7 @@ public sealed partial class SqlCommand : DbCommand, ICloneable
35
35
{
36
36
private static int _objectTypeCount ; // EventSource Counter
37
37
private const int MaxRPCNameLength = 1046 ;
38
- internal readonly int ObjectID = Interlocked . Increment ( ref _objectTypeCount ) ; private string _commandText ;
38
+ internal readonly int ObjectID = Interlocked . Increment ( ref _objectTypeCount ) ;
39
39
40
40
internal sealed class ExecuteReaderAsyncCallContext : AAsyncCallContext < SqlCommand , SqlDataReader , CancellationTokenRegistration >
41
41
{
@@ -113,6 +113,7 @@ protected override void AfterCleared(SqlCommand owner)
113
113
}
114
114
}
115
115
116
+ private string _commandText ;
116
117
private CommandType _commandType ;
117
118
private int ? _commandTimeout ;
118
119
private UpdateRowSource _updatedRowSource = UpdateRowSource . Both ;
@@ -2645,7 +2646,7 @@ private Task<int> InternalExecuteNonQueryAsync(CancellationToken cancellationTok
2645
2646
{
2646
2647
s_diagnosticListener . WriteCommandError ( operationId , this , _transaction , e ) ;
2647
2648
source . SetException ( e ) ;
2648
- context . Dispose ( ) ;
2649
+ context ? . Dispose ( ) ;
2649
2650
}
2650
2651
2651
2652
return returnedTask ;
@@ -2794,7 +2795,7 @@ private Task<SqlDataReader> InternalExecuteReaderAsync(CommandBehavior behavior,
2794
2795
}
2795
2796
2796
2797
source . SetException ( e ) ;
2797
- context . Dispose ( ) ;
2798
+ context ? . Dispose ( ) ;
2798
2799
}
2799
2800
2800
2801
return returnedTask ;
@@ -3051,7 +3052,6 @@ private Task<XmlReader> InternalExecuteXmlReaderAsync(CancellationToken cancella
3051
3052
}
3052
3053
context . Set ( this , source , registration , operationId ) ;
3053
3054
3054
-
3055
3055
Task < XmlReader > returnedTask = source . Task ;
3056
3056
try
3057
3057
{
0 commit comments