[csharp] Update UserAgent in the async version of ClientAPI execute method. (#3723)

* move UserAgent up to the constructor

* userAgent on both constructors.

* update location of UserAgent

* re-ran the petstore generation
This commit is contained in:
James Russo 2019-08-22 08:24:32 -04:00 committed by William Cheng
parent a748e1ff9a
commit 62ca0c78ff
2 changed files with 2 additions and 0 deletions

View File

@ -245,6 +245,7 @@ namespace {{packageName}}.Client
var request = PrepareRequest(
path, method, queryParams, postBody, headerParams, formParams, fileParams,
pathParams, contentType);
RestClient.UserAgent = Configuration.UserAgent;
InterceptRequest(request);
var response = await RestClient.Execute{{^netStandard}}TaskAsync{{/netStandard}}(request);
InterceptResponse(request, response);

View File

@ -202,6 +202,7 @@ namespace Org.OpenAPITools.Client
var request = PrepareRequest(
path, method, queryParams, postBody, headerParams, formParams, fileParams,
pathParams, contentType);
RestClient.UserAgent = Configuration.UserAgent;
InterceptRequest(request);
var response = await RestClient.ExecuteTaskAsync(request);
InterceptResponse(request, response);