From 630139052e8b2f8cab5c49d91f48707f622ca545 Mon Sep 17 00:00:00 2001 From: Nico Lachmuth Date: Tue, 17 Dec 2024 21:09:58 +0100 Subject: [PATCH] make methods of local distributed eventbus virtual --- .../Distributed/LocalDistributedEventBus.cs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs index b63133a388..04d07259a3 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs @@ -81,88 +81,88 @@ public class LocalDistributedEventBus : IDistributedEventBus, ISingletonDependen return Subscribe(typeof(TEvent), handler); } - public IDisposable Subscribe(Func action) where TEvent : class + public virtual IDisposable Subscribe(Func action) where TEvent : class { return _localEventBus.Subscribe(action); } - public IDisposable Subscribe(ILocalEventHandler handler) where TEvent : class + public virtual IDisposable Subscribe(ILocalEventHandler handler) where TEvent : class { return _localEventBus.Subscribe(handler); } - public IDisposable Subscribe() where TEvent : class where THandler : IEventHandler, new() + public virtual IDisposable Subscribe() where TEvent : class where THandler : IEventHandler, new() { return _localEventBus.Subscribe(); } - public IDisposable Subscribe(Type eventType, IEventHandler handler) + public virtual IDisposable Subscribe(Type eventType, IEventHandler handler) { return _localEventBus.Subscribe(eventType, handler); } - public IDisposable Subscribe(IEventHandlerFactory factory) where TEvent : class + public virtual IDisposable Subscribe(IEventHandlerFactory factory) where TEvent : class { return _localEventBus.Subscribe(factory); } - public IDisposable Subscribe(Type eventType, IEventHandlerFactory factory) + public virtual IDisposable Subscribe(Type eventType, IEventHandlerFactory factory) { return _localEventBus.Subscribe(eventType, factory); } - public void Unsubscribe(Func action) where TEvent : class + public virtual void Unsubscribe(Func action) where TEvent : class { _localEventBus.Unsubscribe(action); } - public void Unsubscribe(ILocalEventHandler handler) where TEvent : class + public virtual void Unsubscribe(ILocalEventHandler handler) where TEvent : class { _localEventBus.Unsubscribe(handler); } - public void Unsubscribe(Type eventType, IEventHandler handler) + public virtual void Unsubscribe(Type eventType, IEventHandler handler) { _localEventBus.Unsubscribe(eventType, handler); } - public void Unsubscribe(IEventHandlerFactory factory) where TEvent : class + public virtual void Unsubscribe(IEventHandlerFactory factory) where TEvent : class { _localEventBus.Unsubscribe(factory); } - public void Unsubscribe(Type eventType, IEventHandlerFactory factory) + public virtual void Unsubscribe(Type eventType, IEventHandlerFactory factory) { _localEventBus.Unsubscribe(eventType, factory); } - public void UnsubscribeAll() where TEvent : class + public virtual void UnsubscribeAll() where TEvent : class { _localEventBus.UnsubscribeAll(); } - public void UnsubscribeAll(Type eventType) + public virtual void UnsubscribeAll(Type eventType) { _localEventBus.UnsubscribeAll(eventType); } - public Task PublishAsync(TEvent eventData, bool onUnitOfWorkComplete = true) + public virtual Task PublishAsync(TEvent eventData, bool onUnitOfWorkComplete = true) where TEvent : class { return _localEventBus.PublishAsync(eventData, onUnitOfWorkComplete); } - public Task PublishAsync(Type eventType, object eventData, bool onUnitOfWorkComplete = true) + public virtual Task PublishAsync(Type eventType, object eventData, bool onUnitOfWorkComplete = true) { return _localEventBus.PublishAsync(eventType, eventData, onUnitOfWorkComplete); } - public Task PublishAsync(TEvent eventData, bool onUnitOfWorkComplete = true, bool useOutbox = true) where TEvent : class + public virtual Task PublishAsync(TEvent eventData, bool onUnitOfWorkComplete = true, bool useOutbox = true) where TEvent : class { return _localEventBus.PublishAsync(eventData, onUnitOfWorkComplete); } - public Task PublishAsync(Type eventType, object eventData, bool onUnitOfWorkComplete = true, bool useOutbox = true) + public virtual Task PublishAsync(Type eventType, object eventData, bool onUnitOfWorkComplete = true, bool useOutbox = true) { return _localEventBus.PublishAsync(eventType, eventData, onUnitOfWorkComplete); }