From 0da635ea398a62956cf99a260bc78e65b5635f55 Mon Sep 17 00:00:00 2001 From: David Kallesen Date: Tue, 13 Aug 2024 15:00:34 +0200 Subject: [PATCH] chore: use char instead of string in replace --- src/Atc.Rest.ApiGenerator/Helpers/GenerateHelper.cs | 4 ++-- src/Atc.Rest.ApiGenerator/Models/BaseProjectOptions.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Atc.Rest.ApiGenerator/Helpers/GenerateHelper.cs b/src/Atc.Rest.ApiGenerator/Helpers/GenerateHelper.cs index e62a5cd3b..97dac50b8 100644 --- a/src/Atc.Rest.ApiGenerator/Helpers/GenerateHelper.cs +++ b/src/Atc.Rest.ApiGenerator/Helpers/GenerateHelper.cs @@ -133,8 +133,8 @@ public static bool GenerateServerSln( ArgumentNullException.ThrowIfNull(srcPath); var projectName = projectPrefixName - .Replace(" ", ".", StringComparison.Ordinal) - .Replace("-", ".", StringComparison.Ordinal) + .Replace(' ', '.') + .Replace('-', '.') .Trim(); var rootPath = outputSlnPath.EndsWith(".sln", StringComparison.OrdinalIgnoreCase) diff --git a/src/Atc.Rest.ApiGenerator/Models/BaseProjectOptions.cs b/src/Atc.Rest.ApiGenerator/Models/BaseProjectOptions.cs index 7dff61541..4de23d279 100644 --- a/src/Atc.Rest.ApiGenerator/Models/BaseProjectOptions.cs +++ b/src/Atc.Rest.ApiGenerator/Models/BaseProjectOptions.cs @@ -48,12 +48,12 @@ protected BaseProjectOptions( RouteBase = openApiDocument.GetServerUrlBasePath(); ProjectName = string.IsNullOrEmpty(projectSuffixName) ? projectPrefixName - .Replace(" ", ".", StringComparison.Ordinal) - .Replace("-", ".", StringComparison.Ordinal) + .Replace(' ', '.') + .Replace('-', '.') .Trim() : projectPrefixName - .Replace(" ", ".", StringComparison.Ordinal) - .Replace("-", ".", StringComparison.Ordinal) + .Replace(' ', '.') + .Replace('-', '.') .Trim() + $".{projectSuffixName}"; ProjectPrefixName = ProjectName.Contains('.', StringComparison.Ordinal)