2 Answer(s)
-
0
Hi,
The
CurrentUsercontains the TenantId.You can get the tenant information via
ITenantRepository. Thetenantentity contains it's edition id.// DI private readonly ICurrentUser _currentUser; private readonly ITenantRepository _tenantRepository; private readonly IEditionRepository _editionRepository; ctor(ICurrentUser currentUser, ITenantRepository tenantRepository, IEditionRepository editionRepository){ _currentUser = currentUser; _tenantRepository = tenantRepository; _editionRepository = editionRepository; } public async Task<Guid?> GetEditionId(){ var tenantId = CurrentUser.TenantId; if (!tenantId.HasValue) { return null; } else { var tenant = await _tenantRepository.GetAsync(tenantId.Value); if (!tenant.EditionId.HasValue) { return null; } var edition = await _editionRepository.GetAsync(tenant.EditionId.Value); return edition.Id; } }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
This question has been automatically marked as stale because it has not had recent activity.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)