You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
Now builder.Services.AddTransient<ProductPriceChangedIntegrationEventHandler>(); builder.Services.AddTransient<OrderStatusChangedToShippedIntegrationEventHandler>(); builder.Services.AddTransient<OrderStatusChangedToPaidIntegrationEventHandler>();
var eventBus = app.Services.GetRequiredService<IEventBus>(); eventBus.Subscribe<ProductPriceChangedIntegrationEvent, ProductPriceChangedIntegrationEventHandler>(); eventBus.Subscribe<OrderStatusChangedToShippedIntegrationEvent, OrderStatusChangedToShippedIntegrationEventHandler>(); eventBus.Subscribe<OrderStatusChangedToPaidIntegrationEvent, OrderStatusChangedToPaidIntegrationEventHandler>();
After builder.Services.AddIntegrationEventHandlers(Assembly.GetExecutingAssembly());
Now
builder.Services.AddTransient<ProductPriceChangedIntegrationEventHandler>();
builder.Services.AddTransient<OrderStatusChangedToShippedIntegrationEventHandler>();
builder.Services.AddTransient<OrderStatusChangedToPaidIntegrationEventHandler>();
var eventBus = app.Services.GetRequiredService<IEventBus>();
eventBus.Subscribe<ProductPriceChangedIntegrationEvent, ProductPriceChangedIntegrationEventHandler>();
eventBus.Subscribe<OrderStatusChangedToShippedIntegrationEvent, OrderStatusChangedToShippedIntegrationEventHandler>();
eventBus.Subscribe<OrderStatusChangedToPaidIntegrationEvent, OrderStatusChangedToPaidIntegrationEventHandler>();
After
builder.Services.AddIntegrationEventHandlers(Assembly.GetExecutingAssembly());
app.SubscribeIntegrationEventHandlers(Assembly.GetExecutingAssembly());
I have already implemented and tested this functionality, which works fine and removes unnecessary lines of code from the startup.
The text was updated successfully, but these errors were encountered: