Create tenant with id
I have multiple ABP projects. And I want to create same tenant under some of them with same id. When i look at tenantManager or tenantRepository, i cannot create a tenant with a specific id. How can i do this? Or can you change tenantId from protected to public or add a parameter to tenantManager.createAsync method for tenantId.
- Your ABP Framework version. : 4.4.4
And I want to create same tenant under some of them with same id
Why not make tenant management a separate application? you can share it in multiple projects.
There is two scenarios:
- If i create all tenants (SassTenants data) on a seperate database, i will have problem to understand which records related to which tenant?
- If i create all tenants in every project, then every application gives different id to sameTenant and when i try to combine data for ex. on a datawarehouse, i cannot match data via tenantId for same tenant.
All right.
i cannot create a tenant with a specific id. How can i do this?
This is by design, you can't do it
In fact, you don't need to create a tenant with the same id, since the Tenant entity is extensible, you can use the same business id, see: https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities#entity-extensions-ef-core
For example:
var tenant = TenantManager.CreateAsync("test");
tenant.SetProperty("BusinessId", Guid.NewGuid());
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.