public static async Task <bool> IsTenantValidAsync(this ITenantStore self, string tenantId)
        {
            var tenant = await self.FindTenantByIdAsync(tenantId);

            if (tenant == null || !tenant.Enabled)
            {
                return(false);
            }
            return(true);
        }
        /// <summary>
        /// Finds a tenant by id
        /// </summary>
        /// <param name="tenantId">The tenant id</param>
        /// <returns>
        /// The client
        /// </returns>


        public async Task <TenantHandle> FindTenantByIdAsync(string tenantId)
        {
            if (string.IsNullOrEmpty(tenantId))
            {
                return(null);
            }

            var tenant = await _cache.GetAsync(tenantId,
                                               _options.Caching.ClientStoreExpiration,
                                               () => _inner.FindTenantByIdAsync(tenantId),
                                               _logger);

            return(tenant);
        }
        public async Task <bool> IsTenantValidAsync(string tenantId)
        {
            var tenant = await _tenantStore.FindTenantByIdAsync(tenantId);

            return(tenant != null && tenant.Enabled);
        }
Beispiel #4
0
        public async Task <IActionResult> FindTenantById(int id)
        {
            var result = await _tenantStore.FindTenantByIdAsync(id);

            return(Ok(result));
        }