diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedEventHandler.cs b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs similarity index 82% rename from src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedEventHandler.cs rename to src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs index 1a7599162..0cc55fd2e 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedEventHandler.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs @@ -6,15 +6,15 @@ using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.EventHandling { - public class ProductPriceChangedEventHandler : IIntegrationEventHandler + public class ProductPriceChangedIntegrationEventHandler : IIntegrationEventHandler { private readonly IBasketRepository _repository; - public ProductPriceChangedEventHandler(IBasketRepository repository) + public ProductPriceChangedIntegrationEventHandler(IBasketRepository repository) { _repository = repository; } - public async Task Handle(ProductPriceChangedEvent @event) + public async Task Handle(ProductPriceChangedIntegrationEvent @event) { var userIds = await _repository.GetUsers(); foreach (var id in userIds) diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs b/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs similarity index 81% rename from src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs rename to src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs index b3cc5796f..87d2e9e81 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs @@ -8,7 +8,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even // Integration Events notes: // An Event is “something that has happened in the past”, therefore its name has to be // An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems. - public class ProductPriceChangedEvent : IntegrationEvent + public class ProductPriceChangedIntegrationEvent : IntegrationEvent { public int ProductId { get; private set; } @@ -16,7 +16,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even public decimal OldPrice { get; private set; } - public ProductPriceChangedEvent(int productId, decimal newPrice, decimal oldPrice) + public ProductPriceChangedIntegrationEvent(int productId, decimal newPrice, decimal oldPrice) { ProductId = productId; NewPrice = newPrice; diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index b96029718..3455630f9 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -76,7 +76,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API }); services.AddTransient(); - services.AddTransient, ProductPriceChangedEventHandler>(); + services.AddTransient, ProductPriceChangedIntegrationEventHandler>(); var serviceProvider = services.BuildServiceProvider(); var configuration = serviceProvider.GetRequiredService>().Value; @@ -84,8 +84,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API services.AddSingleton(eventBus); - var catalogPriceHandler = serviceProvider.GetService>(); - eventBus.Subscribe(catalogPriceHandler); + var catalogPriceHandler = serviceProvider.GetService>(); + eventBus.Subscribe(catalogPriceHandler); } diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index fe8ea6ef9..e46c19a56 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -22,7 +22,7 @@ PreserveNewest - + PreserveNewest diff --git a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs index 736ae4d76..431928e0b 100644 --- a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs +++ b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs @@ -146,7 +146,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers item.Price = value.Price; _context.CatalogItems.Update(item); - var @event = new ProductPriceChangedEvent(item.Id, item.Price, oldPrice); + var @event = new ProductPriceChangedIntegrationEvent(item.Id, item.Price, oldPrice); var eventLogEntry = new IntegrationEventLogEntry(@event); _context.IntegrationEventLog.Add(eventLogEntry); diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs.txt b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs.txt deleted file mode 100644 index 4ace69180..000000000 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs.txt +++ /dev/null @@ -1,3 +0,0 @@ - - -// To implement any future integration event handler here diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs similarity index 81% rename from src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs rename to src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs index c757259f9..10b8317da 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs @@ -8,7 +8,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Eve // Integration Events notes: // An Event is “something that has happened in the past”, therefore its name has to be // An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems. - public class ProductPriceChangedEvent : IntegrationEvent + public class ProductPriceChangedIntegrationEvent : IntegrationEvent { public int ProductId { get; private set; } @@ -16,7 +16,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Eve public decimal OldPrice { get; private set; } - public ProductPriceChangedEvent(int productId, decimal newPrice, decimal oldPrice) + public ProductPriceChangedIntegrationEvent(int productId, decimal newPrice, decimal oldPrice) { ProductId = productId; NewPrice = newPrice;