Browse Source

Merge pull request #15891 from abpframework/maliming-patch-1

Update Multi-Tenancy.md
pull/15892/head
liangshiwei 3 years ago
committed by GitHub
parent
commit
c8b0fb5fc2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 36
      docs/en/Multi-Tenancy.md

36
docs/en/Multi-Tenancy.md

@ -32,25 +32,6 @@ 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.
// Return true to stop the pipeline, false to continue.
return true;
};
});
```
### Database Architecture
ABP Framework supports all the following approaches to store the tenant data in the database;
@ -273,6 +254,23 @@ class SomeComponent {
> However, we don't suggest to change this value since some clients may assume the the `__tenant` as the parameter name and they might need to manually configure then.
The `MultiTenancyMiddlewareErrorPageBuilder` 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<AbpAspNetCoreMultiTenancyOptions>(options =>
{
options.MultiTenancyMiddlewareErrorPageBuilder = async (context, exception) =>
{
// Handle the exception.
// Return true to stop the pipeline, false to continue.
return true;
};
});
```
##### Domain/Subdomain Tenant Resolver
In a real application, most of times you will want to determine current tenant either by subdomain (like mytenant1.mydomain.com) or by the whole domain (like mytenant.com). If so, you can configure the `AbpTenantResolveOptions` to add the domain tenant resolver.

Loading…
Cancel
Save