0
talhazengin created
I am working with an abp background worker.
When i injected a repository, scoped or not scoped. The repository only supplies data for tenantless (current tenant is null) records of the entity (entity is a MultiTenant entity). But the system has many tenants. As i see the repository only supplies tenantless records when there is not a current tenant.
I want to inject my entity repository to reach all the records of my entity from all the sources, i mean all the tenant and not tenant related records (tenantfull and tenantless).
How can i do this? Thanks.
2 Answer(s)
-
0
HI @talhazengin, There are two ways:
- Get all tenants and change the current tenant to get their data:
using (_currentTenant.Change(tenant.Id)) { // query.... }
- Disable multi-tenant filter:
using (_dataFilter.Disable<IMultiTenant>()) { // query.... }
-
0
Hi @liangshiwei, Thank you, i choose second :)