Skip to content

Commit 658904c

Browse files
committed
Merge branch 'reviews/uzorrilla' into dev
# Conflicts: # src/Services/Basket/Basket.API/Model/RedisBasketRepository.cs
2 parents 4575487 + c99e5e8 commit 658904c

43 files changed

Lines changed: 215 additions & 240 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eShopOnContainers-ServicesAndWebApps.sln

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,10 @@ EndProject
3939
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ordering.Infrastructure", "src\Services\Ordering\Ordering.Infrastructure\Ordering.Infrastructure.csproj", "{95F1F07C-4D92-4742-BD07-E5B805AAB651}"
4040
EndProject
4141
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest", "test\Services\UnitTest\UnitTest.csproj", "{7796F5D8-31FC-45A4-B673-19DE5BA194CF}"
42-
ProjectSection(ProjectDependencies) = postProject
43-
{A579E108-5445-403D-A407-339AC4D1611B} = {A579E108-5445-403D-A407-339AC4D1611B}
44-
{F16E3C6A-1C94-4EAB-BE91-099618060B68} = {F16E3C6A-1C94-4EAB-BE91-099618060B68}
45-
EndProjectSection
4642
EndProject
4743
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Identity.API", "src\Services\Identity\Identity.API\Identity.API.csproj", "{A579E108-5445-403D-A407-339AC4D1611B}"
4844
EndProject
4945
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{FEA0C318-FFED-4D39-8781-265718CA43DD}"
50-
ProjectSection(ProjectDependencies) = postProject
51-
{A579E108-5445-403D-A407-339AC4D1611B} = {A579E108-5445-403D-A407-339AC4D1611B}
52-
{5B810E3D-112E-4857-B197-F09D2FD41E27} = {5B810E3D-112E-4857-B197-F09D2FD41E27}
53-
{F16E3C6A-1C94-4EAB-BE91-099618060B68} = {F16E3C6A-1C94-4EAB-BE91-099618060B68}
54-
{F0333D8E-0B27-42B7-B2C6-78F3657624E2} = {F0333D8E-0B27-42B7-B2C6-78F3657624E2}
55-
{42681D9D-750A-4DF7-BD9F-9292CFD5C253} = {42681D9D-750A-4DF7-BD9F-9292CFD5C253}
56-
{2110CBB0-3B38-4EE4-A743-DF6968D80D90} = {2110CBB0-3B38-4EE4-A743-DF6968D80D90}
57-
{CFE2FACB-4538-4B99-8A10-306F3882952D} = {CFE2FACB-4538-4B99-8A10-306F3882952D}
58-
{231226CE-690B-4979-8870-9A79D80928E2} = {231226CE-690B-4979-8870-9A79D80928E2}
59-
EndProjectSection
6046
EndProject
6147
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebSPA", "src\Web\WebSPA\WebSPA.csproj", "{F16E3C6A-1C94-4EAB-BE91-099618060B68}"
6248
EndProject

src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Text;
52

63
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions
74
{

src/BuildingBlocks/EventBus/EventBus/Abstractions/IIntegrationEventHandler.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Text;
52
using System.Threading.Tasks;
63

74
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions

src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
42

53
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events
64
{

src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using RabbitMQ.Client;
66
using RabbitMQ.Client.Events;
77
using System;
8-
using System.Collections;
98
using System.Collections.Generic;
109
using System.Linq;
1110
using System.Reflection;
@@ -35,7 +34,9 @@ public EventBusRabbitMQ(string connectionString)
3534

3635
public void Publish(IntegrationEvent @event)
3736
{
38-
var eventName = @event.GetType().Name;
37+
var eventName = @event.GetType()
38+
.Name;
39+
3940
var factory = new ConnectionFactory() { HostName = _connectionString };
4041
using (var connection = factory.CreateConnection())
4142
using (var channel = connection.CreateModel())

src/Services/Basket/Basket.API/BasketSettings.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
5-
6-
namespace Microsoft.eShopOnContainers.Services.Basket.API
1+
namespace Microsoft.eShopOnContainers.Services.Basket.API
72
{
83
public class BasketSettings
94
{

src/Services/Basket/Basket.API/Infrastructure/ActionResults/InternalServerErrorObjectResult.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
using Microsoft.AspNetCore.Http;
22
using Microsoft.AspNetCore.Mvc;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Threading.Tasks;
73

84
namespace Basket.API.Infrastructure.ActionResults
95
{

src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
33
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
44
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
75
using System.Threading.Tasks;
86

97
namespace Basket.API.IntegrationEvents.EventHandling
108
{
119
public class OrderStartedIntegrationEventHandler : IIntegrationEventHandler<OrderStartedIntegrationEvent>
1210
{
1311
private readonly IBasketRepository _repository;
12+
1413
public OrderStartedIntegrationEventHandler(IBasketRepository repository)
1514
{
16-
_repository = repository;
15+
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
1716
}
1817

1918
public async Task Handle(OrderStartedIntegrationEvent @event)

src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
22
using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events;
33
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
4+
using System;
45
using System.Linq;
56
using System.Threading.Tasks;
67

@@ -9,24 +10,28 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even
910
public class ProductPriceChangedIntegrationEventHandler : IIntegrationEventHandler<ProductPriceChangedIntegrationEvent>
1011
{
1112
private readonly IBasketRepository _repository;
13+
1214
public ProductPriceChangedIntegrationEventHandler(IBasketRepository repository)
1315
{
14-
_repository = repository;
16+
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
1517
}
1618

1719
public async Task Handle(ProductPriceChangedIntegrationEvent @event)
1820
{
19-
var userIds = await _repository.GetUsers();
21+
var userIds = await _repository.GetUsersAsync();
22+
2023
foreach (var id in userIds)
2124
{
2225
var basket = await _repository.GetBasketAsync(id);
26+
2327
await UpdatePriceInBasketItems(@event.ProductId, @event.NewPrice, @event.OldPrice, basket);
2428
}
2529
}
2630

2731
private async Task UpdatePriceInBasketItems(int productId, decimal newPrice, decimal oldPrice, CustomerBasket basket)
2832
{
2933
var itemsToUpdate = basket?.Items?.Where(x => int.Parse(x.ProductId) == productId).ToList();
34+
3035
if (itemsToUpdate != null)
3136
{
3237
foreach (var item in itemsToUpdate)

src/Services/Basket/Basket.API/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Threading.Tasks;
62

73
namespace Basket.API.IntegrationEvents.Events
84
{

0 commit comments

Comments
 (0)