namespace VberZero.MultiTenancy; public class TenantStore : Abp.MultiTenancy.ITenantStore { private readonly ITenantCache _tenantCache; public TenantStore(ITenantCache tenantCache) { _tenantCache = tenantCache; } public Abp.MultiTenancy.TenantInfo Find(int tenantId) { var tenant = _tenantCache.GetOrNull(tenantId); if (tenant == null) { return null; } return new Abp.MultiTenancy.TenantInfo(tenant.Id, tenant.TenancyName); } public Abp.MultiTenancy.TenantInfo Find(string tenancyName) { var tenant = _tenantCache.GetOrNull(tenancyName); if (tenant == null) { return null; } return new Abp.MultiTenancy.TenantInfo(tenant.Id, tenant.TenancyName); } public TenantCacheItem FindTenantCache(int tenantId) { var tenant = _tenantCache.GetOrNull(tenantId); return tenant; } public TenantCacheItem FindTenantCache(string tenancyName) { var tenant = _tenantCache.GetOrNull(tenancyName); return tenant; } }