Browse Source

Merge pull request #13159 from abpframework/MultiTenancyMiddlewareErrorPageBuilder

Update the `Multi-Tenancy.md` to explains the `MultiTenancyMiddlewareErrorPageBuilder`.
pull/13160/head
liangshiwei 4 years ago
committed by GitHub
parent
commit
efcbd57675
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      docs/en/Multi-Tenancy.md
  2. 16
      docs/zh-Hans/Multi-Tenancy.md

16
docs/en/Multi-Tenancy.md

@ -32,6 +32,22 @@ Configure<AbpMultiTenancyOptions>(options =>
> Multi-Tenancy is disabled in the ABP Framework by default. However, it is **enabled by default** when you create a new solution using the [startup template](Startup-Templates/Application.md). `MultiTenancyConsts` class in the solution has a constant to control it in a single place.
### AbpMultiTenancyOptions: Handle inactive and non-existent tenants.
The `MultiTenancyMiddlewareErrorPageBuilder` of `AbpMultiTenancyOptions` is used to handle inactive and non-existent tenants.
It will respond to an error page by default, you can change it if you want, eg: only output the error log and continue ASP NET Core's request pipeline.
```csharp
Configure<AbpMultiTenancyOptions>(options =>
{
options.MultiTenancyMiddlewareErrorPageBuilder = async (context, exception) =>
{
// Handle the exception.
};
});
```
### Database Architecture
ABP Framework supports all the following approaches to store the tenant data in the database;

16
docs/zh-Hans/Multi-Tenancy.md

@ -34,6 +34,22 @@ namespace MyCompany.MyProject
> 随着"Multi-tenancy ready"的概念,我们打算开发我们的代码和多租户方法兼容.然后它可以被用于多租户和非多租户的程序中,这取决于最终程序的需求.
### AbpMultiTenancyOptions: 处理不活跃或不存在的租户
`MultiTenancyMiddlewareErrorPageBuilder``AbpMultiTenancyOptions` 用于 处理不活跃或不存在的租户.
默认情况下会响应错误页面, 你可以根据自己的需要更改它, 比如: 只输出错误日志并继续ASP NET Core的请求管道
```csharp
Configure<AbpMultiTenancyOptions>(options =>
{
options.MultiTenancyMiddlewareErrorPageBuilder = async (context, exception) =>
{
// Handle the exception.
};
});
```
#### 定义实体
你可以在你的实体中实现 **IMultiTenant** 接口来实现多租户,例如:

Loading…
Cancel
Save