Skip to content

Commit a0da160

Browse files
committed
Merge from origin/dev to dev
2 parents e996593 + bbc1481 commit a0da160

35 files changed

Lines changed: 299 additions & 222 deletions

File tree

src/BuildingBlocks/EventBus/EventBus/EventBus.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
<ItemGroup>
1010
<Folder Include="Abstractions\" />
11-
<Folder Include="Events\" />
1211
</ItemGroup>
1312

1413
<ItemGroup>

src/BuildingBlocks/EventBus/EventBus/Events/EventStateEnum.cs renamed to src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEventLog/EventStateEnum.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Text;
44

5-
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events
5+
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events.IntegrationEventLog
66
{
77
public enum EventStateEnum
88
{

src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEventLogEntry.cs renamed to src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEventLog/IntegrationEventLogEntry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Text;
44
using Newtonsoft.Json;
55

6-
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events
6+
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events.IntegrationEventLog
77
{
88
public class IntegrationEventLogEntry
99
{

src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedEventHandler.cs renamed to src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs

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

77
namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.EventHandling
88
{
9-
public class ProductPriceChangedEventHandler : IIntegrationEventHandler<ProductPriceChangedEvent>
9+
public class ProductPriceChangedIntegrationEventHandler : IIntegrationEventHandler<ProductPriceChangedIntegrationEvent>
1010
{
1111
private readonly IBasketRepository _repository;
12-
public ProductPriceChangedEventHandler(IBasketRepository repository)
12+
public ProductPriceChangedIntegrationEventHandler(IBasketRepository repository)
1313
{
1414
_repository = repository;
1515
}
1616

17-
public async Task Handle(ProductPriceChangedEvent @event)
17+
public async Task Handle(ProductPriceChangedIntegrationEvent @event)
1818
{
1919
var userIds = await _repository.GetUsers();
2020
foreach (var id in userIds)

src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs renamed to src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even
88
// Integration Events notes:
99
// An Event is “something that has happened in the past”, therefore its name has to be
1010
// An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems.
11-
public class ProductPriceChangedEvent : IntegrationEvent
11+
public class ProductPriceChangedIntegrationEvent : IntegrationEvent
1212
{
1313
public int ProductId { get; private set; }
1414

1515
public decimal NewPrice { get; private set; }
1616

1717
public decimal OldPrice { get; private set; }
1818

19-
public ProductPriceChangedEvent(int productId, decimal newPrice, decimal oldPrice)
19+
public ProductPriceChangedIntegrationEvent(int productId, decimal newPrice, decimal oldPrice)
2020
{
2121
ProductId = productId;
2222
NewPrice = newPrice;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void ConfigureServices(IServiceCollection services)
7777
});
7878

7979
services.AddTransient<IBasketRepository, RedisBasketRepository>();
80-
services.AddTransient<IIntegrationEventHandler<ProductPriceChangedEvent>, ProductPriceChangedEventHandler>();
80+
services.AddTransient<IIntegrationEventHandler<ProductPriceChangedIntegrationEvent>, ProductPriceChangedIntegrationEventHandler>();
8181

8282
var serviceProvider = services.BuildServiceProvider();
8383
var configuration = serviceProvider.GetRequiredService<IOptionsSnapshot<BasketSettings>>().Value;
@@ -103,9 +103,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
103103
app.UseSwagger()
104104
.UseSwaggerUi();
105105

106-
var catalogPriceHandler = app.ApplicationServices.GetService<IIntegrationEventHandler<ProductPriceChangedEvent>>();
106+
var catalogPriceHandler = app.ApplicationServices.GetService<IIntegrationEventHandler<ProductPriceChangedIntegrationEvent>>();
107107
var eventBus = app.ApplicationServices.GetRequiredService<IEventBus>();
108-
eventBus.Subscribe<ProductPriceChangedEvent>(catalogPriceHandler);
108+
eventBus.Subscribe<ProductPriceChangedIntegrationEvent>(catalogPriceHandler);
109109

110110
}
111111

src/Services/Catalog/Catalog.API/Catalog.API.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
2323
</Content>
2424
<Compile Include="IntegrationEvents\EventHandling\AnyFutureIntegrationEventHandler.cs.txt" />
25-
<Compile Include="IntegrationEvents\Events\ProductPriceChangedEvent.cs.txt" />
2625
<Content Update="web.config;">
2726
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
2827
</Content>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Microsoft.AspNetCore.Mvc;
22
using Microsoft.EntityFrameworkCore;
33
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
4-
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
4+
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events.IntegrationEventLog;
55
using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure;
66
using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events;
77
using Microsoft.eShopOnContainers.Services.Catalog.API.Model;
@@ -146,7 +146,7 @@ public async Task<IActionResult> Post([FromBody]CatalogItem value)
146146
item.Price = value.Price;
147147
_context.CatalogItems.Update(item);
148148

149-
var @event = new ProductPriceChangedEvent(item.Id, item.Price, oldPrice);
149+
var @event = new ProductPriceChangedIntegrationEvent(item.Id, item.Price, oldPrice);
150150
var eventLogEntry = new IntegrationEventLogEntry(@event);
151151
_context.IntegrationEventLog.Add(eventLogEntry);
152152

src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{
33
using EntityFrameworkCore.Metadata.Builders;
44
using Microsoft.EntityFrameworkCore;
5-
using Model;
6-
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
5+
using Model;
6+
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events.IntegrationEventLog;
77

88
public class CatalogContext : DbContext
99
{

src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedEvent.cs.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)