[csharp] ApiClient.mustache: Apply ConfigureAwait(false) consistently

This commit is contained in:
Billy Booth
2025-05-07 16:27:42 -05:00
committed by GitHub
parent 4cffd32f87
commit 59936f29f0

View File

@@ -493,7 +493,7 @@ namespace {{packageName}}.Client
{ {
InterceptRequest(request); InterceptRequest(request);
RestResponse<T> response = await getResponse(client); RestResponse<T> response = await getResponse(client).ConfigureAwait(false);
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data // if the response type is oneOf/anyOf, call FromJSON to deserialize the data
if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
@@ -562,7 +562,7 @@ namespace {{packageName}}.Client
{ {
if (policyResult.Outcome == OutcomeType.Successful) if (policyResult.Outcome == OutcomeType.Successful)
{ {
return await client.Deserialize<T>(policyResult.Result, cancellationToken); return await client.Deserialize<T>(policyResult.Result, cancellationToken).ConfigureAwait(false);
} }
else else
{ {
@@ -621,7 +621,7 @@ namespace {{packageName}}.Client
{ {
var policy = RetryConfiguration.AsyncRetryPolicy; var policy = RetryConfiguration.AsyncRetryPolicy;
var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false);
return await DeserializeRestResponseFromPolicyAsync<T>(client, request, policyResult, cancellationToken); return await DeserializeRestResponseFromPolicyAsync<T>(client, request, policyResult, cancellationToken).ConfigureAwait(false);
} }
else else
{ {