Skip to content

Commit 254d479

Browse files
committed
Renaming.
1 parent f502c23 commit 254d479

6 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/Services/Basket/Basket.API/Events/CatalogPriceChangedHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
namespace Basket.API.Events
1010
{
11-
public class CatalogPriceChangedHandler : IIntegrationEventHandler<CatalogPriceChanged>
11+
public class ProductPriceChangedHandler : IIntegrationEventHandler<ProductPriceChanged>
1212
{
1313
private readonly IBasketRepository _repository;
14-
public CatalogPriceChangedHandler(IBasketRepository repository)
14+
public ProductPriceChangedHandler(IBasketRepository repository)
1515
{
1616
_repository = repository;
1717
}
1818

19-
public async Task Handle(CatalogPriceChanged @event)
19+
public async Task Handle(ProductPriceChanged @event)
2020
{
2121
var userIds = await _repository.GetUsers();
2222
foreach (var id in userIds)

src/Services/Basket/Basket.API/Startup.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ public void ConfigureServices(IServiceCollection services)
7979
});
8080

8181
services.AddTransient<IBasketRepository, RedisBasketRepository>();
82-
services.AddTransient<IIntegrationEventHandler<CatalogPriceChanged>, CatalogPriceChangedHandler>();
82+
services.AddTransient<IIntegrationEventHandler<ProductPriceChanged>, ProductPriceChangedHandler>();
8383

8484
var serviceProvider = services.BuildServiceProvider();
8585
var configuration = serviceProvider.GetRequiredService<IOptionsSnapshot<BasketSettings>>().Value;
86-
var eventBus = new EventBus(configuration.EventBusConnection);
86+
var eventBus = new EventBusRabbitMQ(configuration.EventBusConnection);
8787
services.AddSingleton<IEventBus>(eventBus);
8888

8989

90-
var catalogPriceHandler = serviceProvider.GetService<IIntegrationEventHandler<CatalogPriceChanged>>();
91-
eventBus.Subscribe<CatalogPriceChanged>(catalogPriceHandler);
90+
var catalogPriceHandler = serviceProvider.GetService<IIntegrationEventHandler<ProductPriceChanged>>();
91+
eventBus.Subscribe<ProductPriceChanged>(catalogPriceHandler);
9292

9393
}
9494

src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public async Task<IActionResult> Post([FromBody]CatalogItem value)
149149
_context.CatalogItems.Update(item);
150150
await _context.SaveChangesAsync();
151151

152-
var @event = new CatalogPriceChanged(item.Id, item.Price, oldPrice);
152+
var @event = new ProductPriceChanged(item.Id, item.Price, oldPrice);
153153
await ProcessEventAsync(@event);
154154
}
155155

src/Services/Catalog/Catalog.API/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void ConfigureServices(IServiceCollection services)
7777

7878
var serviceProvider = services.BuildServiceProvider();
7979
var configuration = serviceProvider.GetRequiredService<IOptionsSnapshot<Settings>>().Value;
80-
services.AddSingleton<IEventBus>(new EventBus(configuration.EventBusConnection));
80+
services.AddSingleton<IEventBus>(new EventBusRabbitMQ(configuration.EventBusConnection));
8181

8282
services.AddMvc();
8383
}

src/Services/Common/Infrastructure/Catalog/CatalogPriceChanged.cs renamed to src/Services/Common/Infrastructure/Catalog/ProductPriceChanged.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
namespace Microsoft.eShopOnContainers.Services.Common.Infrastructure.Catalog
66
{
7-
public class CatalogPriceChanged : IntegrationEventBase
7+
public class ProductPriceChanged : IntegrationEventBase
88
{
99
public int ItemId { get; private set; }
1010

1111
public decimal NewPrice { get; private set; }
1212

1313
public decimal OldPrice { get; set; }
1414

15-
public CatalogPriceChanged(int itemId, decimal newPrice, decimal oldPrice)
15+
public ProductPriceChanged(int itemId, decimal newPrice, decimal oldPrice)
1616
{
1717
ItemId = itemId;
1818
NewPrice = newPrice;

src/Services/Common/Infrastructure/EventBus.cs renamed to src/Services/Common/Infrastructure/EventBusRabbitMQ.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace Microsoft.eShopOnContainers.Services.Common.Infrastructure
1515
{
16-
public class EventBus : IEventBus
16+
public class EventBusRabbitMQ : IEventBus
1717
{
1818
private readonly string _brokerName = "event_bus";
1919
private readonly string _connectionString;
@@ -24,7 +24,7 @@ public class EventBus : IEventBus
2424
private string _queueName;
2525

2626

27-
public EventBus(string connectionString)
27+
public EventBusRabbitMQ(string connectionString)
2828
{
2929
_connectionString = connectionString;
3030
_handlers = new Dictionary<string, List<IIntegrationEventHandler>>();

0 commit comments

Comments
 (0)