diff --git a/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache b/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache index 5ce03342baa..b8cd6c1b330 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache @@ -158,9 +158,36 @@ namespace {{packageName}}.Client /// public void AddDefaultHeader(string key, string value) { + if (_defaultHeaderMap.ContainsKey(key)) + _defaultHeaderMap.Remove(key); _defaultHeaderMap.Add(key, value); } + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + if (ApiKey.ContainsKey(key)) + ApiKey.Remove(key); + ApiKey.Add(key, value); + } + + /// + /// Sets the API key prefix. + /// + /// 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. ///