0

I am using aspnetzero for my development in .net and angular. When I enable the multitenancy in my project than abpsession tenantid is not getting set. It is null. If I disable it than host tenant id is getting set, which I want to set in case of multitenancy enabled case also. Is there any other setting which needs to be done?

Tried using using (var uow =_unitOfWorkManager.Begin(TransactionScopeOption.RequiresNew)) {

                using (_unitOfWorkManager.Current.SetTenantId(1))
                {
                    _dbContextProvider.GetDbContext().Database.OpenConnection();
                    uow.Complete();
                }
            }

1 is the host id but it is not working.

Aashima
  • 1
  • 1
  • When using ASP.NET Zero with multitenancy enabled, the AbpSession.TenantId should automatically be set for each tenant's session. Remember that Host tenant id is null. Try creating a new tenant and see if its still null. – Murat Şanlısavaş Jul 31 '23 at 10:42
  • TenantId should be automatically set based on the current tenant context. If it's null, check the multitenancy configuration, middleware order, and tenant identification strategy. Ensure custom tenant resolvers are implemented correctly and use CurrentTenant.Id to access the current tenant's Id. – Manoj Agrawal Jul 31 '23 at 10:57

0 Answers0