コード例 #1
0
ファイル: TenantAccessService.cs プロジェクト: lulzzz/codex
        /// <summary>
        /// Get the current tenant
        /// </summary>
        /// <returns></returns>
        public async Task <Tenant?> GetTenantAsync()
        {
            var tenantIdentifier = await _tenantResolutionStrategy.GetTenantIdentifierAsync();

            if (string.IsNullOrWhiteSpace(tenantIdentifier))
            {
                return(null);
            }
            return(await _tenantStore.GetTenantAsync(tenantIdentifier));
        }
コード例 #2
0
        public async Task <TenantConfig> GetTenantFromHostAsync()
        {
            var tenantIdentifier = await _tenantResolutionStrategy.GetTenantIdentifierAsync();

            if (tenantIdentifier == _appSettings.BaseHost)
            {
                return(new TenantConfig()
                {
                    Name = _appSettings.BaseHost
                });
            }

            return(await _multiTenantContext.TenantConfigs.FirstOrDefaultAsync(x => x.Name == tenantIdentifier));
        }
コード例 #3
0
        public async Task <T> GetTenantAsync()
        {
            var tenantIdentifier = await _tenantResolutionStrategy.GetTenantIdentifierAsync();

            return(await _tenantStore.GetTenantAsync(tenantIdentifier));
        }
コード例 #4
0
        public async Task <Tenant> GetTenantAsync()
        {
            string tenantIdentifier = await _tenantResolutionStrategy.GetTenantIdentifierAsync();

            return(await _tenantStore.GetTenantAsync(tenantIdentifier.ToLowerInvariant()));
        }
コード例 #5
0
        /// <summary>
        /// Get the current tenant
        /// </summary>
        /// <returns></returns>
        public async Task <T> GetTenantAsync()
        {
            var(domainName, ipAddress, name) = await _tenantResolutionStrategy.GetTenantIdentifierAsync();

            return(await _tenantStore.GetTenantAsync(domainName, ipAddress, name));
        }