- ABP Framework version: v7.3.4
- UI Type: Blazor Server
- Database System: EF Core (SQL Server
-
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
- Steps to reproduce the issue:
we add this code to all configuresservices
Configure<AbpMultiTenancyOptions>(options =>
{
options.IsEnabled = MultiTenancyConsts.IsEnabled;
});
and we Replace Services MultiTenantConnectionStringResolver with https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs
and we add connection string to tenant configuration(Test Tenant)
But we login with test tenant with special connection string but abp loaded to grid with data to default connection(Host) string database
MultiTenant ConnectionString property doesn't work.
8 Answer(s)
-
0
Can you share a test project? I will check it.
My email is shiwei.liang@volosoft.com
-
0
Of course I sent MultitenantTest.rar via We transfer.
-
0
We want to Multi tenant project only database level not table level.
-
0
Hi,
The Deneme entity have to implement
IMultiTenant
interface.This is a convention, otherwise, the APB framework will use it as a host entity
-
0
But we already use different db by tenant. why do we implement entity IMultiTenant interface
-
0
Hi,
Yes, this is a design. Suppose you want to create an entity as a host entity,, what should you do. Some tenants use separate databases, and some tenants use shared databases., How to filter the data.
IMultiTenant
interface is an identifier used to indicate that the entity is a multi-tenant entity, It is designed for the above scenarios. -
0
How can We change from tenantId (Guid) to KurumId(int). We must use exist old mssql db.(db first)
-
0
How can We change from tenantId (Guid) to KurumId(int).
Sorry, it's not possible. see: https://github.com/abpframework/abp/issues/1704#issuecomment-527372545
You can consider to add a new property type as KurumId(int), then use it as your business primary key:
ObjectExtensionManager.Instance .MapEfCoreProperty<Tenant, int>( "KurumId", (entityBuilder, propertyBuilder) => { propertyBuilder.HasIndex() .IsUnique(); } );