From aaa821bb49e97d4abb2c2250fcb53bfc7f2f4bc6 Mon Sep 17 00:00:00 2001 From: Christian Arenas Date: Tue, 16 May 2017 18:39:54 +0200 Subject: [PATCH] Modify payment DI --- .../CommandHandlers/PayOrderCommandMsgHandler.cs | 5 ++++- src/Services/Payment/Payment.API/Payment.API.csproj | 3 +++ src/Services/Payment/Payment.API/Startup.cs | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Services/Payment/Payment.API/IntegrationCommands/CommandHandlers/PayOrderCommandMsgHandler.cs b/src/Services/Payment/Payment.API/IntegrationCommands/CommandHandlers/PayOrderCommandMsgHandler.cs index c0023909c..178b36474 100644 --- a/src/Services/Payment/Payment.API/IntegrationCommands/CommandHandlers/PayOrderCommandMsgHandler.cs +++ b/src/Services/Payment/Payment.API/IntegrationCommands/CommandHandlers/PayOrderCommandMsgHandler.cs @@ -12,7 +12,10 @@ private readonly IPaymentIntegrationEventService _paymentIntegrationEventService; public PayOrderCommandMsgHandler(IPaymentIntegrationEventService paymentIntegrationEventService) - => _paymentIntegrationEventService = paymentIntegrationEventService; + { + _paymentIntegrationEventService = paymentIntegrationEventService; + } + public async Task Handle(PayOrderCommandMsg @event) { diff --git a/src/Services/Payment/Payment.API/Payment.API.csproj b/src/Services/Payment/Payment.API/Payment.API.csproj index 7f741fa53..de3636585 100644 --- a/src/Services/Payment/Payment.API/Payment.API.csproj +++ b/src/Services/Payment/Payment.API/Payment.API.csproj @@ -29,6 +29,9 @@ + + + diff --git a/src/Services/Payment/Payment.API/Startup.cs b/src/Services/Payment/Payment.API/Startup.cs index b8b3b9b66..eaef3f704 100644 --- a/src/Services/Payment/Payment.API/Startup.cs +++ b/src/Services/Payment/Payment.API/Startup.cs @@ -12,6 +12,7 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; using RabbitMQ.Client; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; using Payment.API.IntegrationEvents; +using Payment.API.IntegrationCommands.CommandHandlers; namespace Payment.API { @@ -49,7 +50,7 @@ namespace Payment.API }); services.AddSingleton(); services.AddSingleton(); - services.AddTransient>(); + services.AddTransient, PayOrderCommandMsgHandler>(); services.AddSwaggerGen();