Exemplo n.º 1
0
        private static void DomainStuff()
        {
            DomainEventsHandler.Register <AccountCreated>(CreateAccount);

            var account = new Account()
            {
                Id   = 1,
                Name = "My Account"
            };

            account.CreateNewAccount();
        }
        protected override void HandleMessageBegin(TMessageType message)
        {
            var messageType = message.GetType();

            if (!Handlers.ContainsKey(messageType))
            {
                return;
            }

            var handlers = Handlers[messageType];

            foreach (var handler in handlers)
            {
                DomainEventsHandler.Register(messageType, handler);
            }
        }