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