Skip to content

Commit aaa821b

Browse files
committed
Modify payment DI
1 parent 12dd8ac commit aaa821b

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/Services/Payment/Payment.API/IntegrationCommands/CommandHandlers/PayOrderCommandMsgHandler.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ public class PayOrderCommandMsgHandler : IIntegrationEventHandler<PayOrderComman
1212
private readonly IPaymentIntegrationEventService _paymentIntegrationEventService;
1313

1414
public PayOrderCommandMsgHandler(IPaymentIntegrationEventService paymentIntegrationEventService)
15-
=> _paymentIntegrationEventService = paymentIntegrationEventService;
15+
{
16+
_paymentIntegrationEventService = paymentIntegrationEventService;
17+
}
18+
1619

1720
public async Task Handle(PayOrderCommandMsg @event)
1821
{

src/Services/Payment/Payment.API/Payment.API.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj" />
3030
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
3131
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.csproj" />
32+
<ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.AspNetCore.HealthChecks\Microsoft.AspNetCore.HealthChecks.csproj" />
33+
<ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks.SqlServer\Microsoft.Extensions.HealthChecks.SqlServer.csproj" />
34+
<ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj" />
3235
</ItemGroup>
3336

3437
</Project>

src/Services/Payment/Payment.API/Startup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using RabbitMQ.Client;
1313
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
1414
using Payment.API.IntegrationEvents;
15+
using Payment.API.IntegrationCommands.CommandHandlers;
1516

1617
namespace Payment.API
1718
{
@@ -49,7 +50,7 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
4950
});
5051
services.AddSingleton<IEventBus, EventBusRabbitMQ>();
5152
services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>();
52-
services.AddTransient<IIntegrationEventHandler<PayOrderCommandMsg>>();
53+
services.AddTransient<IIntegrationEventHandler<PayOrderCommandMsg>, PayOrderCommandMsgHandler>();
5354

5455

5556
services.AddSwaggerGen();

0 commit comments

Comments
 (0)