using LINGYUN.Abp.Saas.Tenants; using LY.MicroService.Applications.Single.MultiTenancy; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Uow; namespace LY.MicroService.Applications.Single.EventBus.Distributed { public class TenantEventHandler : IDistributedEventHandler>, IDistributedEventHandler>, IDistributedEventHandler>, IDistributedEventHandler, ITransientDependency { protected ITenantConfigurationCache TenantConfigurationCache { get; } public TenantEventHandler( ITenantConfigurationCache tenantConfigurationCache) { TenantConfigurationCache = tenantConfigurationCache; } [UnitOfWork] public async virtual Task HandleEventAsync(EntityCreatedEto eventData) { await TenantConfigurationCache.RefreshAsync(); } public async virtual Task HandleEventAsync(EntityUpdatedEto eventData) { await TenantConfigurationCache.RefreshAsync(); } public async virtual Task HandleEventAsync(EntityDeletedEto eventData) { await TenantConfigurationCache.RefreshAsync(); } public async virtual Task HandleEventAsync(TenantConnectionStringUpdatedEto eventData) { await TenantConfigurationCache.RefreshAsync(); } } }