Browse Source

Merge b8ee746ab3 into 0742f941fb

pull/570/merge
Roma Marusyk 6 years ago
committed by GitHub
parent
commit
c380eb43d7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs
  2. +2
    -2
      src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs

+ 2
- 2
src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs View File

@ -15,9 +15,9 @@ namespace Basket.API.IntegrationEvents.EventHandling
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
}
public async Task Handle(OrderStartedIntegrationEvent @event)
public Task Handle(OrderStartedIntegrationEvent @event)
{
await _repository.DeleteBasketAsync(@event.UserId.ToString());
return _repository.DeleteBasketAsync(@event.UserId);
}
}
}


+ 2
- 2
src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs View File

@ -24,11 +24,11 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even
{
var basket = await _repository.GetBasketAsync(id);
await UpdatePriceInBasketItems(@event.ProductId, @event.NewPrice, @event.OldPrice, basket);
await UpdatePriceInBasketItemsAsync(@event.ProductId, @event.NewPrice, @event.OldPrice, basket);
}
}
private async Task UpdatePriceInBasketItems(int productId, decimal newPrice, decimal oldPrice, CustomerBasket basket)
private async Task UpdatePriceInBasketItemsAsync(int productId, decimal newPrice, decimal oldPrice, CustomerBasket basket)
{
string match = productId.ToString();
var itemsToUpdate = basket?.Items?.Where(x => x.ProductId == match).ToList();


Loading…
Cancel
Save