Browse Source
Merge pull request #2370 from abpframework/maliming/RemoteService
When RemoteService is disabled, the selector of the service or service method is no longer configured.
pull/2381/head
Halil İbrahim Kalkan
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
13 additions and
0 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpServiceConvention.cs
|
|
|
@ -171,6 +171,13 @@ namespace Volo.Abp.AspNetCore.Mvc.Conventions |
|
|
|
{ |
|
|
|
RemoveEmptySelectors(controller.Selectors); |
|
|
|
|
|
|
|
var controllerType = controller.ControllerType.AsType(); |
|
|
|
var remoteServiceAtt = ReflectionHelper.GetSingleAttributeOrDefault<RemoteServiceAttribute>(controllerType.GetTypeInfo()); |
|
|
|
if (remoteServiceAtt != null && !remoteServiceAtt.IsEnabledFor(controllerType)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (controller.Selectors.Any(selector => selector.AttributeRouteModel != null)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
@ -188,6 +195,12 @@ namespace Volo.Abp.AspNetCore.Mvc.Conventions |
|
|
|
{ |
|
|
|
RemoveEmptySelectors(action.Selectors); |
|
|
|
|
|
|
|
var remoteServiceAtt = ReflectionHelper.GetSingleAttributeOrDefault<RemoteServiceAttribute>(action.ActionMethod); |
|
|
|
if (remoteServiceAtt != null && !remoteServiceAtt.IsEnabledFor(action.ActionMethod)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!action.Selectors.Any()) |
|
|
|
{ |
|
|
|
AddAbpServiceSelector(rootPath, controllerName, action, configuration); |
|
|
|
|