Ejemplo n.º 1
0
        public void Apply(ProductPriceChanged @event)
        {
            var view    = ServiceLocator.ProductView;
            var product = view.GetById(@event.Id);

            product.Price = @event.NewPrice;
        }
Ejemplo n.º 2
0
        public void Apply(ProductPriceChanged e)
        {
            var product = GetById(e.Id);

            product.Price   = e.NewPrice;
            product.Version = e.Version;
            repository.Update(product);
        }
Ejemplo n.º 3
0
        public async Task HandleAsync(ProductPriceChanged @event)
        {
            var cart = await cartRepository.GetByIdAsync(@event.AggregateId.IdAsString());


            var priceItem = new ProductPriceDto()
            {
                CurrentPrice = @event.Quantity,
                Id           = @event.PriceId,
                Date         = DateTimeOffset.Now,
                ItemId       = cart.Id
            };

            cart.Price = @event.Quantity;
            await cartRepository.UpdateAsync(cart);

            await cartItemRepository.InsertAsync(priceItem);
        }
Ejemplo n.º 4
0
 private void Apply(ProductPriceChanged e)
 {
     Price = e.NewPrice;
 }
Ejemplo n.º 5
0
 void Apply(ProductPriceChanged e)
 {
     _price = e.Price;
 }
Ejemplo n.º 6
0
 public void Apply(ProductPriceChanged productPriceChanged)
 {
     this.Price = productPriceChanged.Price;
 }
Ejemplo n.º 7
0
 protected bool Equals(ProductPriceChanged other) =>
 base.Equals(other) && Price == other.Price && OccurredOn.Equals(other.OccurredOn) && Version == other.Version;
Ejemplo n.º 8
0
 public void WhenProductPriceChanged(ProductPriceChanged @event)
 {
     Price = @event.Price;
 }