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); } }
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); } }
public SimpleUserEventChannelHandlerTest() { _fooEventCatcher = new FooEventCatcher(); _allEventCatcher = new AllEventCatcher(); _channel = new EmbeddedChannel(_fooEventCatcher, _allEventCatcher); }