Beispiel #1
0
        public virtual void Register(IEnumerable <ICommandHandler> handlers)
        {
            Ensure.That(handlers, "handlers").IsNotNull();

            foreach (var handler in handlers)
            {
                if (!Registrations.TryAdd(handler.CommandType, handler))
                {
                    throw Exceptions.CanNotAddCommandHandlerRegistration(handler);
                }
            }
        }