tangxuehua / enode

ENode is a framework aims to help us developing ddd, cqrs, eda, and event sourcing style applications.
http://www.cnblogs.com/netfocus/category/496012.html
MIT License
1.81k stars 564 forks source link

获取聚合根Handle时如果是级联继承,是否应该将子类以及父类的Handle一起加载 #77

Closed xbOnline closed 5 years ago

xbOnline commented 5 years ago
    public Action<IAggregateRoot, IDomainEvent> GetInternalEventHandler(Type aggregateRootType, Type eventType)
    {
        IDictionary<Type, Action<IAggregateRoot, IDomainEvent>> eventHandlerDic;
        if (!_mappings.TryGetValue(aggregateRootType, out eventHandlerDic)) return null;
        Action<IAggregateRoot, IDomainEvent> eventHandler;
        return eventHandlerDic.TryGetValue(eventType, out eventHandler) ? eventHandler : null;
    }

以上是否应该将父类的handle一起加载?

tangxuehua commented 5 years ago

fixed.