diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index 932984387..204bd3300 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -31,7 +31,6 @@ using System; using System.Data.Common; using System.Reflection; - using global::Ordering.API.Application.IntegrationEvents.EventHandling; public class Startup { @@ -125,13 +124,7 @@ return new DefaultRabbitMQPersistentConnection(factory, logger); }); - RegisterServiceBus(services); - services.AddSingleton(); - services.AddSingleton(); - services.AddTransient(); - services.AddTransient, OrderProcessSaga>(); - services.AddTransient(); - services.AddTransient(); + RegisterServiceBus(services); services.AddOptions(); //configure autofac @@ -176,36 +169,24 @@ { services.AddSingleton(); services.AddSingleton(); - - services.AddTransient>(); services.AddTransient, OrderProcessSaga>(); - services.AddTransient, - OrderStockConfirmedIntegrationEventHandler>(); - services.AddTransient, - OrderStockNotConfirmedIntegrationEventHandler>(); - services.AddTransient, - OrderPaymentFailedIntegrationEventHandler>(); - services.AddTransient, - OrderPaymentSuccededIntegrationEventHandler>(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); } private void ConfigureEventBus(IApplicationBuilder app) { var eventBus = app.ApplicationServices.GetRequiredService(); - eventBus.Subscribe>(); eventBus.Subscribe>(); - eventBus.Subscribe>(); - eventBus.Subscribe>(); - eventBus.Subscribe>(); - eventBus.Subscribe>(); - eventBus.Subscribe(); - - eventBus.Subscribe>(); - + eventBus.Subscribe(); eventBus.Subscribe(); - eventBus.Subscribe(); + eventBus.Subscribe(); + eventBus.Subscribe(); } protected virtual void ConfigureAuth(IApplicationBuilder app)