private void DoAddSubscriber(
            Type handlerType,
            Type messageType,
            string messageName,
            bool isDynamic)
        {
            Assert.NotNull(handlerType, nameof(handlerType));
            Assert.NotNullOrEmpty(messageName, nameof(messageName));

            if (!_subscribers.ContainsKey(messageName))
            {
                _subscribers.Add(messageName, _subscriberCollection.New());
            }

            if (_subscribers[messageName].Any(s => s.MessageHandlerType == handlerType))
            {
                throw new ArgumentException(
                          $"Handler Type {handlerType.Name} already registered for '{messageName}'", nameof(handlerType));
            }

            if (isDynamic)
            {
                _subscribers[messageName].Add(MessageSubscriberDescriptor.Dynamic(messageName, handlerType));
            }
            else
            {
                Assert.NotNull(messageType, nameof(messageType));

                _subscribers[messageName].Add(MessageSubscriberDescriptor.Typed(messageType, handlerType));
            }
        }
 public void UnsubscribeDynamic <TMessageHandler>(string messageName)
     where TMessageHandler : IDynamicMessageHandler
 {
     DoRemoveSubcriber(messageName, MessageSubscriberDescriptor.Dynamic(messageName, typeof(TMessageHandler)));
 }