Modify payment DI

This commit is contained in:
Christian Arenas 2017-05-16 18:39:54 +02:00
parent 12dd8acef9
commit aaa821bb49
3 changed files with 9 additions and 2 deletions

View File

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

View File

@ -29,6 +29,9 @@
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj" /> <ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" /> <ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.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> </ItemGroup>
</Project> </Project>

View File

@ -12,6 +12,7 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ;
using RabbitMQ.Client; using RabbitMQ.Client;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
using Payment.API.IntegrationEvents; using Payment.API.IntegrationEvents;
using Payment.API.IntegrationCommands.CommandHandlers;
namespace Payment.API namespace Payment.API
{ {
@ -49,7 +50,7 @@ namespace Payment.API
}); });
services.AddSingleton<IEventBus, EventBusRabbitMQ>(); services.AddSingleton<IEventBus, EventBusRabbitMQ>();
services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>(); services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>();
services.AddTransient<IIntegrationEventHandler<PayOrderCommandMsg>>(); services.AddTransient<IIntegrationEventHandler<PayOrderCommandMsg>, PayOrderCommandMsgHandler>();
services.AddSwaggerGen(); services.AddSwaggerGen();