diff --git a/.gitignore b/.gitignore index 4858be2ef6..f5616caf6a 100644 --- a/.gitignore +++ b/.gitignore @@ -255,4 +255,5 @@ paket-files/ build/outputs src/AbpDesk/AbpDesk.Web.Mvc/Logs /src/Volo.Abp.Identity.HttpApi.Host/Logs -samples/MicroserviceDemo/MicroserviceDemo.Web/Logs/*.txt +src/MicroserviceDemo/MicroserviceDemo.Web/Logs/*.txt +src/MicroserviceDemo/MicroserviceDemo.TenantService/Logs/*.txt diff --git a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpServiceConvention.cs b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpServiceConvention.cs index 3b4efd8bf1..0b47d16bb5 100644 --- a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpServiceConvention.cs +++ b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpServiceConvention.cs @@ -230,8 +230,19 @@ namespace Volo.Abp.AspNetCore.Mvc.Conventions protected virtual string GetRootPathOrDefault(Type controllerType) { - return GetControllerSettingOrNull(controllerType)?.RootPath ?? - ModuleApiDescriptionModel.DefaultRootPath; + var controllerSetting = GetControllerSettingOrNull(controllerType); + if (controllerSetting?.RootPath != null) + { + return GetControllerSettingOrNull(controllerType)?.RootPath; + } + + var areaAttribute = controllerType.GetCustomAttributes().OfType().FirstOrDefault(); + if (areaAttribute.RouteValue != null) + { + return areaAttribute.RouteValue; + } + + return ModuleApiDescriptionModel.DefaultRootPath; } [CanBeNull] diff --git a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalControllerSetting.cs b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalControllerSetting.cs index 10ba9b0912..ac504b6546 100644 --- a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalControllerSetting.cs +++ b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalControllerSetting.cs @@ -73,19 +73,23 @@ namespace Volo.Abp.AspNetCore.Mvc.Conventions private static bool IsRemoteService(Type type) { - if (!typeof(IRemoteService).IsAssignableFrom(type) || !type.IsPublic || type.IsAbstract || type.IsGenericType) + if (!type.IsPublic || type.IsAbstract || type.IsGenericType) { return false; } var remoteServiceAttr = ReflectionHelper.GetSingleAttributeOrDefault(type); - if (remoteServiceAttr != null && !remoteServiceAttr.IsEnabledFor(type)) { return false; } - return true; + if (typeof(IRemoteService).IsAssignableFrom(type)) + { + return true; + } + + return false; } } } \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.HttpApi.Proxy/Volo/Abp/MultiTenancy/TenantController.cs b/src/Volo.Abp.MultiTenancy.HttpApi.Proxy/Volo/Abp/MultiTenancy/TenantController.cs index 2736cc0347..86fb200d3a 100644 --- a/src/Volo.Abp.MultiTenancy.HttpApi.Proxy/Volo/Abp/MultiTenancy/TenantController.cs +++ b/src/Volo.Abp.MultiTenancy.HttpApi.Proxy/Volo/Abp/MultiTenancy/TenantController.cs @@ -2,10 +2,13 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; namespace Volo.Abp.MultiTenancy { [Controller] + [RemoteService] + [Area("multi-tenancy")] public class TenantController : ITenantAppService //TODO: Throws exception on validation if we inherit from Controller { private readonly ITenantAppService _service;