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 ad808e6026..a0096ef9ac 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposeServicesAttribute.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposeServicesAttribute.cs @@ -9,9 +9,9 @@ namespace Volo.Abp.DependencyInjection { public Type[] ServiceTypes { get; } - public bool? IncludeDefaults { get; set; } + public bool IncludeDefaults { get; set; } - public bool? IncludeSelf { get; set; } + public bool IncludeSelf { get; set; } public ExposeServicesAttribute(params Type[] serviceTypes) { @@ -22,19 +22,19 @@ namespace Volo.Abp.DependencyInjection { var serviceList = ServiceTypes.ToList(); - if (IncludeDefaults == true) + if (IncludeDefaults) { foreach (var type in GetDefaultServices(targetType)) { serviceList.AddIfNotContains(type); } - if (IncludeSelf != false) + if (IncludeSelf) { serviceList.AddIfNotContains(targetType); } } - else if (IncludeSelf == true) + else if (IncludeSelf) { serviceList.AddIfNotContains(targetType); } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposedServiceExplorer.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposedServiceExplorer.cs index f7324014d4..cb0d727795 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposedServiceExplorer.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposedServiceExplorer.cs @@ -10,7 +10,8 @@ namespace Volo.Abp.DependencyInjection private static readonly ExposeServicesAttribute DefaultExposeServicesAttribute = new ExposeServicesAttribute { - IncludeDefaults = true + IncludeDefaults = true, + IncludeSelf = true }; public static List GetExposedServices(Type type)