Ejemplo n.º 1
0
            public static TransientDomainEventPubSub CreateInstance(IServiceProvider provider)
            {
                var publisher = new TransientDomainEventPubSub();

                publisher.AddSubscriber <CartCreatedEvent>(async @event => await provider.GetService <IDomainEventHandler <CartId, CartCreatedEvent> >().HandleAsync(@event));
                publisher.AddSubscriber <ProductAddedEvent>(async @event => await provider.GetService <IDomainEventHandler <CartId, ProductAddedEvent> >().HandleAsync(@event));
                publisher.AddSubscriber <ProductQuantityChangedEvent>(async @event => await provider.GetService <IDomainEventHandler <CartId, ProductQuantityChangedEvent> >().HandleAsync(@event));

                return(publisher);
            }
 public TransientDomainEventPublisherTest()
 {
     sut = new TransientDomainEventPubSub();
 }