Browse Source

Modify payment DI

pull/223/head
Christian Arenas 7 years ago
parent
commit
aaa821bb49
3 changed files with 9 additions and 2 deletions
  1. +4
    -1
      src/Services/Payment/Payment.API/IntegrationCommands/CommandHandlers/PayOrderCommandMsgHandler.cs
  2. +3
    -0
      src/Services/Payment/Payment.API/Payment.API.csproj
  3. +2
    -1
      src/Services/Payment/Payment.API/Startup.cs

+ 4
- 1
src/Services/Payment/Payment.API/IntegrationCommands/CommandHandlers/PayOrderCommandMsgHandler.cs View File

@ -12,7 +12,10 @@
private readonly IPaymentIntegrationEventService _paymentIntegrationEventService;
public PayOrderCommandMsgHandler(IPaymentIntegrationEventService paymentIntegrationEventService)
=> _paymentIntegrationEventService = paymentIntegrationEventService;
{
_paymentIntegrationEventService = paymentIntegrationEventService;
}
public async Task Handle(PayOrderCommandMsg @event)
{


+ 3
- 0
src/Services/Payment/Payment.API/Payment.API.csproj View File

@ -29,6 +29,9 @@
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.AspNetCore.HealthChecks\Microsoft.AspNetCore.HealthChecks.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks.SqlServer\Microsoft.Extensions.HealthChecks.SqlServer.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj" />
</ItemGroup>
</Project>

+ 2
- 1
src/Services/Payment/Payment.API/Startup.cs View File

@ -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<IEventBus, EventBusRabbitMQ>();
services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>();
services.AddTransient<IIntegrationEventHandler<PayOrderCommandMsg>>();
services.AddTransient<IIntegrationEventHandler<PayOrderCommandMsg>, PayOrderCommandMsgHandler>();
services.AddSwaggerGen();


Loading…
Cancel
Save