diff --git a/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache b/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache index 5ce03342baa..d2d7a9ad34b 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache @@ -158,9 +158,24 @@ namespace {{packageName}}.Client /// public void AddDefaultHeader(string key, string value) { + if (_defaultHeaderMap.ContainsKey(key)) + _defaultHeaderMap.Remove(key); _defaultHeaderMap.Add(key, value); } + /// + /// Add Api Key. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKeyPrefix(string key, string value) + { + if (ApiKeyPrefix.ContainsKey(key)) + ApiKeyPrefix.Remove(key); + ApiKeyPrefix.Add(key, value); + } + /// /// Gets or sets the HTTP user agent. ///