diff --git a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceControllerFeatureProvider.cs b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceControllerFeatureProvider.cs index 284ffe8401..4542879b20 100644 --- a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceControllerFeatureProvider.cs +++ b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceControllerFeatureProvider.cs @@ -1,17 +1,12 @@ -using System; using System.Reflection; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Volo.Abp.Application.Services; -using Volo.Abp.Http; using Volo.Abp.Reflection; namespace Volo.Abp.AspNetCore.Mvc { - /// - /// Used to add application services as controller. - /// public class AbpAppServiceControllerFeatureProvider : ControllerFeatureProvider { private readonly IAbpApplication _application; @@ -25,7 +20,7 @@ namespace Volo.Abp.AspNetCore.Mvc { var type = typeInfo.AsType(); - if (!typeof(IApplicationService).IsAssignableFrom(type) || + if (!typeof(IRemoteService).IsAssignableFrom(type) || !typeInfo.IsPublic || typeInfo.IsAbstract || typeInfo.IsGenericType) { return false; diff --git a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceConvention.cs b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceConvention.cs index d291b2ece3..5eacf0445b 100644 --- a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceConvention.cs +++ b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceConvention.cs @@ -37,7 +37,7 @@ namespace Volo.Abp.AspNetCore.Mvc var controllerType = controller.ControllerType.AsType(); var configuration = GetControllerSettingOrNull(controllerType); - if (IsApplicationService(controllerType)) + if (IsRemoteService(controllerType)) { controller.ControllerName = controller.ControllerName.RemovePostFix(ApplicationService.CommonPostfixes); configuration?.ControllerModelConfigurer(controller); @@ -314,9 +314,9 @@ namespace Volo.Abp.AspNetCore.Mvc return selector.AttributeRouteModel == null && selector.ActionConstraints.IsNullOrEmpty(); } - protected virtual bool IsApplicationService(Type controllerType) + protected virtual bool IsRemoteService(Type controllerType) { - return typeof(IApplicationService).GetTypeInfo().IsAssignableFrom(controllerType); + return typeof(IRemoteService).GetTypeInfo().IsAssignableFrom(controllerType); } } } \ No newline at end of file diff --git a/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs b/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs index a2795d77c1..9a0e2d287d 100644 --- a/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs +++ b/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs @@ -23,7 +23,7 @@ namespace Microsoft.Extensions.DependencyInjection //TODO: Add option to change type filter var serviceTypes = assembly.GetTypes().Where(t => - t.IsInterface && t.IsPublic && typeof(IApplicationService).IsAssignableFrom(t) + t.IsInterface && t.IsPublic && typeof(IRemoteService).IsAssignableFrom(t) ); foreach (var serviceType in serviceTypes) diff --git a/src/Volo.Abp/Volo.Abp.csproj b/src/Volo.Abp/Volo.Abp.csproj index 25275b1d64..be558fc887 100644 --- a/src/Volo.Abp/Volo.Abp.csproj +++ b/src/Volo.Abp/Volo.Abp.csproj @@ -27,8 +27,4 @@ - - - - diff --git a/src/Volo.Abp/Volo/Abp/Application/Services/IApplicationService.cs b/src/Volo.Abp/Volo/Abp/Application/Services/IApplicationService.cs index 7877982e04..6abfeed78e 100644 --- a/src/Volo.Abp/Volo/Abp/Application/Services/IApplicationService.cs +++ b/src/Volo.Abp/Volo/Abp/Application/Services/IApplicationService.cs @@ -5,7 +5,7 @@ namespace Volo.Abp.Application.Services /// /// This interface must be implemented by all application services to register and identify them by convention. /// - public interface IApplicationService : ITransientDependency + public interface IApplicationService : ITransientDependency, IRemoteService { } diff --git a/src/Volo.Abp/Volo/Abp/Application/Services/IRemoteService.cs b/src/Volo.Abp/Volo/Abp/Application/Services/IRemoteService.cs new file mode 100644 index 0000000000..4d61398a5c --- /dev/null +++ b/src/Volo.Abp/Volo/Abp/Application/Services/IRemoteService.cs @@ -0,0 +1,6 @@ +namespace Volo.Abp.Application.Services +{ + public interface IRemoteService + { + } +} \ No newline at end of file diff --git a/src/Volo.Abp.Http/Volo/Abp/Http/RemoteServiceAttribute.cs b/src/Volo.Abp/Volo/Abp/Application/Services/RemoteServiceAttribute.cs similarity index 94% rename from src/Volo.Abp.Http/Volo/Abp/Http/RemoteServiceAttribute.cs rename to src/Volo.Abp/Volo/Abp/Application/Services/RemoteServiceAttribute.cs index 14d3e73684..47ad389404 100644 --- a/src/Volo.Abp.Http/Volo/Abp/Http/RemoteServiceAttribute.cs +++ b/src/Volo.Abp/Volo/Abp/Application/Services/RemoteServiceAttribute.cs @@ -1,11 +1,11 @@ using System; using System.Reflection; -namespace Volo.Abp.Http +namespace Volo.Abp.Application.Services { [Serializable] [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Method)] - public class RemoteServiceAttribute : Attribute + public class RemoteServiceAttribute : Attribute //TODO: Consider to move to another namespace (with IRemoteService)? { /// /// Default: true. diff --git a/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs index 49b41a5fae..b2797567ea 100644 --- a/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs +++ b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Application.Services; using Volo.Abp.AspNetCore.Mvc; namespace Volo.Abp.Http.DynamicProxying