From 58cdfb92503cdfd9041e7bc93a718cc1ca2e38a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 13 Sep 2023 18:10:03 +0300 Subject: [PATCH 1/2] Resolves #17625: Do not remove Integration postfix for auto controllers for integration services --- .../Volo/Abp/Application/Services/ApplicationService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs index f0d23fa865..4eb285df04 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs @@ -40,7 +40,7 @@ public abstract class ApplicationService : [Obsolete("Use LazyServiceProvider instead.")] public IServiceProvider ServiceProvider { get; set; } = default!; - public static string[] CommonPostfixes { get; set; } = { "AppService", "ApplicationService", "IntService", "IntegrationService", "Service" }; + public static string[] CommonPostfixes { get; set; } = { "AppService", "ApplicationService", "Service" }; public List AppliedCrossCuttingConcerns { get; } = new(); From 4cc49dffa7721d004c31163e2d6bfcbaa2140191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 13 Sep 2023 18:39:49 +0300 Subject: [PATCH 2/2] Introduce IgnoredUrlSuffixesInControllerNames --- .../Mvc/Conventions/AbpConventionalControllerOptions.cs | 2 ++ .../Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpConventionalControllerOptions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpConventionalControllerOptions.cs index 1b8e7fcb1b..a8a2c2db54 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpConventionalControllerOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpConventionalControllerOptions.cs @@ -20,6 +20,8 @@ public class AbpConventionalControllerOptions /// public bool UseV3UrlStyle { get; set; } + public string[] IgnoredUrlSuffixesInControllerNames { get; set; } = new[] { "Integration" }; + public AbpConventionalControllerOptions() { ConventionalControllerSettings = new ConventionalControllerSettingList(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs index 7e5b364b3e..58dda9fb92 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs @@ -109,7 +109,7 @@ public class ConventionalRouteBuilder : IConventionalRouteBuilder, ITransientDep { if (configuration?.UrlControllerNameNormalizer == null) { - return controllerName; + return controllerName.RemovePostFix(Options.IgnoredUrlSuffixesInControllerNames); } return configuration.UrlControllerNameNormalizer(