Skip to content

Commit 30de860

Browse files
committed
Applies .ConfigureAwait(false) for QueryCommand in await using
1 parent a8a269d commit 30de860

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

Extensions/Xtensive.Orm.BulkOperations/Internals/BulkDeleteOperation.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ protected async override Task<int> ExecuteInternalAsync(CancellationToken token
4545
var request = GetRequest(query);
4646
Bindings = request.ParameterBindings.ToList();
4747

48-
await using var command = CreateCommand(request);
49-
return await command.ExecuteNonQueryAsync(token).ConfigureAwait(false);
48+
var command = CreateCommand(request);
49+
await using (command.ConfigureAwait(false)) {
50+
return await command.ExecuteNonQueryAsync(token).ConfigureAwait(false);
51+
}
5052
}
5153

5254
private QueryCommand CreateCommand(QueryTranslationResult request)

Extensions/Xtensive.Orm.BulkOperations/Internals/BulkUpdateOperation.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ protected async override Task<int> ExecuteInternalAsync(CancellationToken token
4848
var request = GetRequest(query);
4949
Bindings = request.ParameterBindings.ToList();
5050

51-
await using var command = CreateCommand(request);
52-
return await command.ExecuteNonQueryAsync(token).ConfigureAwait(false);
51+
var command = CreateCommand(request);
52+
await using (command.ConfigureAwait(false)) {
53+
return await command.ExecuteNonQueryAsync(token).ConfigureAwait(false);
54+
}
5355
}
5456

5557
private QueryCommand CreateCommand(QueryTranslationResult request)

Extensions/Xtensive.Orm.BulkOperations/Internals/InsertOperation.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ protected async override Task<int> ExecuteInternalAsync(CancellationToken token
3939
}
4040
Bindings = new List<QueryParameterBinding>();
4141

42-
await using var command = CreateCommand();
43-
return await command.ExecuteNonQueryAsync(token).ConfigureAwait(false);
42+
var command = CreateCommand();
43+
await using (command.ConfigureAwait(false)) {
44+
return await command.ExecuteNonQueryAsync(token).ConfigureAwait(false);
45+
}
4446
}
4547

4648
private QueryCommand CreateCommand()

0 commit comments

Comments
 (0)