コード例 #1
0
        public async Task ExecuteAsync(TCommand command, CancellationToken cancellationToken = default)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            var catcher = new AllEventCatcher(/*this.MessagePublisher, this.DomainEventConverter*/ this);

            DomainEventPublisher.Current.Subscribe(catcher);

            try
            {
                await this.ExecuteAsyncImpl(command, cancellationToken);
            }
            finally
            {
                DomainEventPublisher.Current.Unsubscribe(catcher);
            }
        }
コード例 #2
0
        public void Execute(TCommand command)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            var catcher = new AllEventCatcher(/*this.MessagePublisher, this.DomainEventConverter*/ this);

            DomainEventPublisher.Current.Subscribe(catcher);

            try
            {
                this.ExecuteImpl(command);
            }
            finally
            {
                DomainEventPublisher.Current.Unsubscribe(catcher);
            }
        }
コード例 #3
0
 public SimpleUserEventChannelHandlerTest()
 {
     _fooEventCatcher = new FooEventCatcher();
     _allEventCatcher = new AllEventCatcher();
     _channel         = new EmbeddedChannel(_fooEventCatcher, _allEventCatcher);
 }