Merge branch 'dev' into blazor-server-tiered

pull/8137/head
Halil İbrahim Kalkan 5 years ago
commit 2212ba927a

@ -155,9 +155,9 @@ The projects have been explained before. Now, we can explain the reasons of the
* `Application.Contracts` depends on the `Domain.Shared`. In this way, you can reuse these types in the DTOs. For example, the same `IssueType` enum in the `Domain.Shared` can be used by a `CreateIssueDto` as a property.
* `Application` depends on the `Application.Contracts` since it implements the Application Service interfaces and uses the DTOs inside it. It also depends on the `Domain` since the Application Services are implemented using the Domain Objects defined inside it.
* `EntityFrameworkCore` depends on the `Domain` since it maps the Domain Objects (entities and value types) to database tables (as it is an ORM) and implements the repository interfaces defined in the `Domain`.
* `HttpApi` depends on the `Application.Contacts` since the Controllers inside it inject and use the Application Service interfaces as explained before.
* `HttpApi.Client` depends on the `Application.Contacts` since it can consume the Application Services as explained before.
* `Web` depends on the `HttpApi` since it serves the HTTP APIs defined inside it. Also, in this way, it indirectly depends on the `Application.Contacts` project to consume the Application Services in the Pages/Components.
* `HttpApi` depends on the `Application.Contracts` since the Controllers inside it inject and use the Application Service interfaces as explained before.
* `HttpApi.Client` depends on the `Application.Contracts` since it can consume the Application Services as explained before.
* `Web` depends on the `HttpApi` since it serves the HTTP APIs defined inside it. Also, in this way, it indirectly depends on the `Application.Contracts` project to consume the Application Services in the Pages/Components.
#### Dashed Dependencies
@ -1801,7 +1801,7 @@ Such a design makes it even more important to distinguish between Domain logic a
To be more clear about the implementation, you can create different projects (`.csproj`) for each application types. For example;
* `IssueTracker.Admin.Application` & `IssueTracker.Admin.Application.Contacts` projects for the Back Office (admin) Application.
* `IssueTracker.Admin.Application` & `IssueTracker.Admin.Application.Contracts` projects for the Back Office (admin) Application.
* `IssueTracker.Public.Application` & `IssueTracker.Public.Application.Contracts` projects for the Public Web Application.
* `IssueTracker.Mobile.Application` & `IssueTracker.Mobile.Application.Contracts` projects for the Mobile Application.

@ -1116,7 +1116,7 @@ namespace Acme.BookStore.Blazor.Pages
await GetAuthorsAsync();
StateHasChanged();
await InvokeAsync(StateHasChanged);
}
private void OpenCreateAuthorModal()

@ -153,9 +153,9 @@ ABP的启动解决方案中包含两个用于集成Entity Framework Core的项
* `Application.Contracts` 依赖`Domain.Shared`项目,可以在DTO中重用`Domain.Shared`中的类型.例如,`Domain.Shared`项目中的枚举类型 `IssueType` 同样被`Contracts`项目中的`CreateIssueDto`DTO所引用.
* `Application` 依赖`Application.Contracts`项目,因为此项目需要实现应用服务的接口及接口使用的DTO.另外也依赖`Domain`项目,因为应用服务的实现必须依赖领域层中的对象.
* `EntityFrameworkCore` 依赖`Domain`项目,因为此项目需要将领域对象(实体或值对象)映射到数据库的表,另外还需要实现`Domain`项目中的仓储接口.
* `HttpApi` 依赖`Application.Contacts`项目,因为Controllers需要注入应用服务.
* `HttpApi.Client` 依赖`Application.Contacts`项目,因为此项目需要是使用应用服务.
* `Web` 依赖`HttpApi`项目,因为此项目对外提供HTTP APIs.另外Pages或Components 需要使用应用服务,所以还间接依赖了`Application.Contacts`项目
* `HttpApi` 依赖`Application.Contracts`项目,因为Controllers需要注入应用服务.
* `HttpApi.Client` 依赖`Application.Contracts`项目,因为此项目需要是使用应用服务.
* `Web` 依赖`HttpApi`项目,因为此项目对外提供HTTP APIs.另外Pages或Components 需要使用应用服务,所以还间接依赖了`Application.Contracts`项目
#### 虚线依赖
@ -1798,7 +1798,7 @@ public async Task ChangeTitleAsync(Issue issue, string title)
为了更清楚的实现,你可以为不同的应用类型创建不同的项目(`.csproj`):
* `IssueTracker.Admin.Application``IssueTracker.Admin.Application.Contacts` 为后台管理系统提供服务.
* `IssueTracker.Admin.Application``IssueTracker.Admin.Application.Contracts` 为后台管理系统提供服务.
* `IssueTracker.Public.Application``IssueTracker.Public.Application.Contracts` 为公开网站提供服务.
* `IssueTracker.Mobile.Application``IssueTracker.Mobile.Application.Contracts` 为移动端应用提供服务.

@ -1,22 +0,0 @@
using System;
using Volo.Abp.ExceptionHandling;
namespace Volo.Abp.GlobalFeatures
{
public class AbpGlobalFeatureNotEnableException : AbpException, IHasErrorCode
{
public string Code { get; }
public AbpGlobalFeatureNotEnableException(string message = null, string code = null, Exception innerException = null)
: base(message, innerException)
{
Code = code;
}
public AbpGlobalFeatureNotEnableException WithData(string name, object value)
{
Data[name] = value;
return this;
}
}
}

@ -0,0 +1,23 @@
using System;
using Volo.Abp.ExceptionHandling;
namespace Volo.Abp.GlobalFeatures
{
[Serializable]
public class AbpGlobalFeatureNotEnabledException : AbpException, IHasErrorCode
{
public string Code { get; }
public AbpGlobalFeatureNotEnabledException(string message = null, string code = null, Exception innerException = null)
: base(message, innerException)
{
Code = code;
}
public AbpGlobalFeatureNotEnabledException WithData(string name, object value)
{
Data[name] = value;
return this;
}
}
}

@ -5,9 +5,9 @@ namespace Volo.Abp.GlobalFeatures
{
public static class GlobalFeatureHelper
{
public static bool IsGlobalFeatureEnabled(Type controllerType, out RequiresGlobalFeatureAttribute attribute)
public static bool IsGlobalFeatureEnabled(Type type, out RequiresGlobalFeatureAttribute attribute)
{
attribute = ReflectionHelper.GetSingleAttributeOrDefault<RequiresGlobalFeatureAttribute>(controllerType);
attribute = ReflectionHelper.GetSingleAttributeOrDefault<RequiresGlobalFeatureAttribute>(type);
return attribute == null || GlobalFeatureManager.Instance.IsEnabled(attribute.GetFeatureName());
}
}

@ -17,7 +17,7 @@ namespace Volo.Abp.GlobalFeatures
if (!GlobalFeatureHelper.IsGlobalFeatureEnabled(invocation.TargetObject.GetType(), out var attribute))
{
throw new AbpGlobalFeatureNotEnableException(code: AbpGlobalFeatureErrorCodes.GlobalFeatureIsNotEnabled)
throw new AbpGlobalFeatureNotEnabledException(code: AbpGlobalFeatureErrorCodes.GlobalFeatureIsNotEnabled)
.WithData("ServiceName", invocation.TargetObject.GetType().FullName)
.WithData("GlobalFeatureName", attribute.Name);
}

@ -19,7 +19,7 @@ namespace Volo.Abp.GlobalFeatures
{
using (CultureHelper.Use("zh-Hans"))
{
var exception = new AbpGlobalFeatureNotEnableException(code: AbpGlobalFeatureErrorCodes.GlobalFeatureIsNotEnabled)
var exception = new AbpGlobalFeatureNotEnabledException(code: AbpGlobalFeatureErrorCodes.GlobalFeatureIsNotEnabled)
.WithData("ServiceName", "MyService")
.WithData("GlobalFeatureName", "TestFeature");;
var errorInfo = _exceptionToErrorInfoConverter.Convert(exception, false);

@ -20,7 +20,7 @@ namespace Volo.Abp.GlobalFeatures
[Fact]
public async Task Interceptor_Test()
{
var ex = await Assert.ThrowsAsync<AbpGlobalFeatureNotEnableException>(async () =>
var ex = await Assert.ThrowsAsync<AbpGlobalFeatureNotEnabledException>(async () =>
{
await _testAppServiceV1.TestMethod();
});

@ -16,8 +16,8 @@ namespace Volo.Abp.Identity.MongoDB
{
options.AddRepository<IdentityUser, MongoIdentityUserRepository>();
options.AddRepository<IdentityRole, MongoIdentityRoleRepository>();
options.AddRepository<IdentityClaimType, MongoIdentityRoleRepository>();
options.AddRepository<OrganizationUnit, MongoIdentityRoleRepository>();
options.AddRepository<IdentityClaimType, MongoIdentityClaimTypeRepository>();
options.AddRepository<OrganizationUnit, MongoOrganizationUnitRepository>();
options.AddRepository<IdentitySecurityLog, MongoIdentitySecurityLogRepository>();
options.AddRepository<IdentityLinkUser, MongoIdentityLinkUserRepository>();
});

@ -219,6 +219,8 @@ $projects = (
"modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB",
"modules/feature-management/src/Volo.Abp.FeatureManagement.Web",
"modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor",
"modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.Server",
"modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.WebAssembly",
# modules/identity
"modules/identity/src/Volo.Abp.Identity.Application.Contracts",
@ -232,6 +234,8 @@ $projects = (
"modules/identity/src/Volo.Abp.Identity.MongoDB",
"modules/identity/src/Volo.Abp.Identity.Web",
"modules/identity/src/Volo.Abp.Identity.Blazor",
"modules/identity/src/Volo.Abp.Identity.Blazor.Server",
"modules/identity/src/Volo.Abp.Identity.Blazor.WebAssembly",
"modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity",
# modules/identityserver
@ -252,9 +256,13 @@ $projects = (
"modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB",
"modules/permission-management/src/Volo.Abp.PermissionManagement.Web",
"modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor",
"modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.Server",
"modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.WebAssembly",
# modules/setting-management
"modules/setting-management/src/Volo.Abp.SettingManagement.Blazor",
"modules/setting-management/src/Volo.Abp.SettingManagement.Blazor.Server",
"modules/setting-management/src/Volo.Abp.SettingManagement.Blazor.WebAssembly",
"modules/setting-management/src/Volo.Abp.SettingManagement.Domain",
"modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared",
"modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore",
@ -265,6 +273,8 @@ $projects = (
"modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts",
"modules/tenant-management/src/Volo.Abp.TenantManagement.Application",
"modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor",
"modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor.Server",
"modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor.WebAssembly",
"modules/tenant-management/src/Volo.Abp.TenantManagement.Domain",
"modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared",
"modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore",

Loading…
Cancel
Save