diff --git a/src/NSwag.CodeGeneration/OperationNameGenerators/MultipleClientsFromPathSegmentsOperationNameGenerator.cs b/src/NSwag.CodeGeneration/OperationNameGenerators/MultipleClientsFromPathSegmentsOperationNameGenerator.cs index eac4d298df..a7478e60a9 100644 --- a/src/NSwag.CodeGeneration/OperationNameGenerators/MultipleClientsFromPathSegmentsOperationNameGenerator.cs +++ b/src/NSwag.CodeGeneration/OperationNameGenerators/MultipleClientsFromPathSegmentsOperationNameGenerator.cs @@ -80,8 +80,8 @@ internal static string CapitalizeFirst(string name) return string.Empty; } - var capitalized = name.ToLower(); - return char.ToUpper(capitalized[0]) + (capitalized.Length > 1 ? capitalized.Substring(1) : ""); + var capitalized = name.ToLowerInvariant(); + return char.ToUpperInvariant(capitalized[0]) + (capitalized.Length > 1 ? capitalized.Substring(1) : ""); } } } \ No newline at end of file diff --git a/src/NSwag.CodeGeneration/OperationNameGenerators/SingleClientFromPathSegmentsOperationNameGenerator.cs b/src/NSwag.CodeGeneration/OperationNameGenerators/SingleClientFromPathSegmentsOperationNameGenerator.cs index 1081477ee8..648cf3f8be 100644 --- a/src/NSwag.CodeGeneration/OperationNameGenerators/SingleClientFromPathSegmentsOperationNameGenerator.cs +++ b/src/NSwag.CodeGeneration/OperationNameGenerators/SingleClientFromPathSegmentsOperationNameGenerator.cs @@ -81,8 +81,8 @@ internal static string CapitalizeFirst(string name) return string.Empty; } - var capitalized = name.ToLower(); - return char.ToUpper(capitalized[0]) + (capitalized.Length > 1 ? capitalized.Substring(1) : ""); + var capitalized = name.ToLowerInvariant(); + return char.ToUpperInvariant(capitalized[0]) + (capitalized.Length > 1 ? capitalized.Substring(1) : ""); } } } \ No newline at end of file