maliming
3 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
3 additions and
10 deletions
-
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs
|
|
|
@ -139,26 +139,19 @@ public class LocalEventBus : EventBusBase, ILocalEventBus, ISingletonDependency |
|
|
|
|
|
|
|
protected override IEnumerable<EventTypeWithEventHandlerFactories> GetHandlerFactories(Type eventType) |
|
|
|
{ |
|
|
|
var handlerFactoryList = new List<EventTypeWithEventHandlerFactories>(); |
|
|
|
|
|
|
|
var handlerWithTypes = new List<Tuple<IEventHandlerFactory, Type, int>>(); |
|
|
|
var handlerFactoryList = new List<Tuple<IEventHandlerFactory, Type, int>>(); |
|
|
|
foreach (var handlerFactory in HandlerFactories.Where(hf => ShouldTriggerEventForHandler(eventType, hf.Key))) |
|
|
|
{ |
|
|
|
foreach (var factory in handlerFactory.Value) |
|
|
|
{ |
|
|
|
handlerWithTypes.Add(new Tuple<IEventHandlerFactory, Type, int>( |
|
|
|
handlerFactoryList.Add(new Tuple<IEventHandlerFactory, Type, int>( |
|
|
|
factory, |
|
|
|
handlerFactory.Key, |
|
|
|
ReflectionHelper.GetAttributesOfMemberOrDeclaringType<LocalEventHandlerOrderAttribute>(factory.GetHandler().EventHandler.GetType()).FirstOrDefault()?.Order ?? 0)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
foreach (var handlerWithType in handlerWithTypes.OrderBy(x => x.Item3)) |
|
|
|
{ |
|
|
|
handlerFactoryList.Add(new EventTypeWithEventHandlerFactories(handlerWithType.Item2, new List<IEventHandlerFactory>{ handlerWithType.Item1 })); |
|
|
|
} |
|
|
|
|
|
|
|
return handlerFactoryList.ToArray(); |
|
|
|
return handlerFactoryList.OrderBy(x => x.Item3).Select(x => new EventTypeWithEventHandlerFactories(x.Item2, new List<IEventHandlerFactory> {x.Item1})).ToArray(); |
|
|
|
} |
|
|
|
|
|
|
|
private List<IEventHandlerFactory> GetOrCreateHandlerFactories(Type eventType) |
|
|
|
|