diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposeServicesAttribute.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposeServicesAttribute.cs index f05ce07239..bfbf4e018a 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposeServicesAttribute.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposeServicesAttribute.cs @@ -60,7 +60,7 @@ public class ExposeServicesAttribute : Attribute, IExposedServiceTypesProvider interfaceName = interfaceName.Right(interfaceName.Length - 1); } - if (type.Name.EndsWith(interfaceName)) + if (type.Name.EndsWith(interfaceName, StringComparison.OrdinalIgnoreCase)) { serviceTypes.Add(interfaceType); } diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/AutoRegistrationHelper_Tests.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/AutoRegistrationHelper_Tests.cs index 5d8716a70c..f13744de3a 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/AutoRegistrationHelper_Tests.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/AutoRegistrationHelper_Tests.cs @@ -20,6 +20,22 @@ public class AutoRegistrationHelper_Tests exposedServices.ShouldContain(typeof(IDerivedService)); } + [Fact] + public void Should_Get_Conventional_Exposed_Types_By_Default_Case_Insensitive() + { + //Act + + var exposedServices = ExposedServiceExplorer.GetExposedServices(typeof(defaultderivedservice)); + + //Assert + + exposedServices.Count.ShouldBe(3); + exposedServices.ShouldContain(typeof(defaultderivedservice)); + exposedServices.ShouldContain(typeof(IService)); + exposedServices.ShouldContain(typeof(IDerivedService)); + } + + [Fact] public void Should_Get_Custom_Exposed_Types_If_Available() { @@ -52,6 +68,10 @@ public class AutoRegistrationHelper_Tests { } + public class defaultderivedservice : IDerivedService + { + } + public interface IService { }