예제 #1
0
        public PurchaseCommandHandler(IPurchaseRepostiory purchaseRepository, IEventBus serviceBus, IEmailService emailService,
                                      IHttpClientFactory httpClientFactory)
        {
            this.purchaseRepository = purchaseRepository;
            this.serviceBus         = serviceBus;
            this.emailService       = emailService;
            this.httpClientFactory  = httpClientFactory;

            // Circuit breaker policy defined
            circuitAsyncBreakerPolicy = Policy
                                        .Handle <RpcException>().CircuitBreakerAsync(2, TimeSpan.FromSeconds(15));
        }
 public ProductPurchaseQueryHandler(IPurchaseRepostiory purchaseRepository)
 {
     this.purchaseRepository = purchaseRepository;
 }