You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m implementing multitenancy with separate databases for each tenant. Everything works fine with a single database, but I’m encountering an issue with the separate database solution. As I understand it, in ABP's generic repository implementation in EfCoreRepository.cs (here), if an entity does not implement the IMultitenant interface, it is considered a host entity and does not follow the tenant context set by the caller code.
This behavior works as expected with a single database. However, in a solution where all entities are multitenant and stored in separate databases, implementing IMultitenant and having the TenantId field on all tables is not very helpful. Originally, it was meant to be a marker, but it’s now performing two roles.
I had to implement the interface for all my custom entities, but the problem arises when using ABP library entities. For example, with the Settings module, I encounter an issue where the entity is inaccessible, and it doesn’t implement the IMultitenant interface. I really don’t want a global storage solution for settings across all tenants.
To work around this, I’m considering implementing my own settings manager. However, I would appreciate a cleaner solution that allows me to retain ABP's built-in settings management while resolving this issue.
Thanks in advance for any suggestions or solutions!
#ABP
#abp
#multitenancy
The text was updated successfully, but these errors were encountered:
implementing IMultitenant and having the TenantId field on all tables is not very helpful. Originally, it was meant to be a marker, but it’s now performing two roles.
If entities stored in the tenant database don't have the IMultitenant interface, it'll cause many problems.
First, you don't know if a queried entity belongs to a tenant.
Hi all,
First, thank you for open-sourcing this fantastic framework. I’ve been using the ABP Framework in an application with the following setup:
ABP Framework version: 8.3.1 (non-commercial)
.NET Core: 8
Database: MSSQL
I’m implementing multitenancy with separate databases for each tenant. Everything works fine with a single database, but I’m encountering an issue with the separate database solution. As I understand it, in ABP's generic repository implementation in EfCoreRepository.cs (here), if an entity does not implement the IMultitenant interface, it is considered a host entity and does not follow the tenant context set by the caller code.
This behavior works as expected with a single database. However, in a solution where all entities are multitenant and stored in separate databases, implementing IMultitenant and having the TenantId field on all tables is not very helpful. Originally, it was meant to be a marker, but it’s now performing two roles.
I had to implement the interface for all my custom entities, but the problem arises when using ABP library entities. For example, with the Settings module, I encounter an issue where the entity is inaccessible, and it doesn’t implement the IMultitenant interface. I really don’t want a global storage solution for settings across all tenants.
To work around this, I’m considering implementing my own settings manager. However, I would appreciate a cleaner solution that allows me to retain ABP's built-in settings management while resolving this issue.
Thanks in advance for any suggestions or solutions!
#ABP
#abp
#multitenancy
The text was updated successfully, but these errors were encountered: