File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/main/resources/handlebars/csharp Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,6 @@ namespace {{packageName}}.Client
113
113
ApiKey = new { {^net35} }Concurrent{ {/net35} }Dictionary<string , string >();
114
114
ApiKeyPrefix = new { {^net35} }Concurrent{ {/net35} }Dictionary<string , string >();
115
115
116
- // Setting Timeout has side effects (forces ApiClient creation).
117
116
Timeout = 100000;
118
117
}
119
118
@@ -236,15 +235,16 @@ namespace {{packageName}}.Client
236
235
/// </summary>
237
236
public virtual IDictionary<string, string> DefaultHeader { get; set; }
238
237
238
+ private int _timeout = 100000;
239
239
/// <summary>
240
240
/// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds.
241
241
/// </summary>
242
242
public virtual int Timeout
243
243
{
244
- {{#netStandard}}get { return (int)ApiClient.RestClient.Timeout.GetValueOrDefault(TimeSpan.FromSeconds(0)).TotalMilliseconds; }
245
- set { ApiClient.RestClient.Timeout = TimeSpan.FromMilliseconds(value); }{{/netStandard}}{{^netStandard}}
246
- get { return ApiClient.RestClient.Timeout; }
247
- set { ApiClient.RestClient.Timeout = value; }{{/netStandard}}
244
+ {{#netStandard}}get { if (_apiClient == null) { return _timeout; } else {return (int)ApiClient.RestClient.Timeout.GetValueOrDefault(TimeSpan.FromSeconds(0)).TotalMilliseconds; } }
245
+ set { _timeout = value; if (_apiClient != null) { ApiClient.RestClient.Timeout = TimeSpan.FromMilliseconds(_timeout); } }{{/netStandard}}{{^netStandard}}
246
+ get { if (_apiClient == null) { return _timeout; } else { return ApiClient.RestClient.Timeout; } }
247
+ set { _timeout = value; if (_apiClient != null) { ApiClient.RestClient.Timeout = _timeout;} }{{/netStandard}}
248
248
}
249
249
250
250
/// <summary>
You can’t perform that action at this time.
0 commit comments