Exemplo n.º 1
0
 private void Apply(ItemRemovedFromCart @event)
 {
     if (Cart.ContainsKey(@event.CartEntryId))
     {
         Cart.Remove(@event.CartEntryId);
     }
 }
Exemplo n.º 2
0
        public void Apply(ItemRemovedFromCart evt)
        {
            var removed = Items.RemoveAll(x => x.Id == evt.Id);

            if (removed == 0)
            {
                throw new ItemNotFoundException();
            }
        }
Exemplo n.º 3
0
        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'");
 }
Exemplo n.º 5
0
        public void Apply(ItemRemovedFromCart e)
        {
            var item = itemsInCart.First(i => i.ItemNumber == e.ItemNumber);

            itemsInCart.Remove(item);
        }