Is there a way to apply IMultiTenant globally to all entities without implementing it individually? #22823
-
Hi team, I'm working with ABP.IO in a multi-tenant architecture using a shared database strategy, and I understand that all entities that should be tenant-specific must implement the IMultiTenant interface. However, implementing IMultiTenant manually on every entity becomes tedious and error-prone, especially as the domain model grows. I was wondering: Is there any way to configure this globally, so that all entities (or entities that inherit from a common base class) automatically behave as tenant-specific, without needing to explicitly implement the IMultiTenant interface? Alternatively, is there a base entity class or configuration pattern you recommend for enforcing multi-tenancy filters across the board? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
hi You can create a new
|
Beta Was this translation helpful? Give feedback.
hi
You can create a new
BaseClass
that implements theIMultiTenant
, and use it as the base class for all entities.MultiTenantEntity
andMultiTenantAggregateRoot