public void RegisterInternalHandler(Type aggregateRootType, Type eventType, MethodInfo eventHandler)
{
IDictionary<Type, MethodInfo> eventHandlerDic;
if (!_mappings.TryGetValue(aggregateRootType, out eventHandlerDic))
{
eventHandlerDic = new Dictionary<Type, MethodInfo>();
_mappings.Add(aggregateRootType, eventHandlerDic);
}
if (eventHandlerDic.ContainsKey(eventType))
{
throw new EventSourcingException(string.Format("聚合根({0})上定义了重复的事件({1})响应函数。", aggregateRootType.FullName, eventType.FullName));
}
eventHandlerDic.Add(eventType, eventHandler);
}