private void Apply(ItemRemovedFromCart @event) { if (Cart.ContainsKey(@event.CartEntryId)) { Cart.Remove(@event.CartEntryId); } }
public void Apply(ItemRemovedFromCart evt) { var removed = Items.RemoveAll(x => x.Id == evt.Id); if (removed == 0) { throw new ItemNotFoundException(); } }
void Removed(ItemRemovedFromCart message) { var cart = _cartRepository.Get(); cart.Items -= message.Quantity; cart.Total -= message.Price * (decimal)message.Quantity; _cartRepository.Update(cart); CartChanged(cart); }
public void Process(ItemRemovedFromCart @event) { _logger.Information($"Item with article '{@event.Article} removed from cart'"); }
public void Apply(ItemRemovedFromCart e) { var item = itemsInCart.First(i => i.ItemNumber == e.ItemNumber); itemsInCart.Remove(item); }