Exemple #1
0
 public Product(ResetProductCommand command)
 {
     ApplyChange(new ProductCreatedEvent(command.ProductId)
     {
         Name         = command.Name,
         Url          = command.Url,
         Price        = command.Price,
         CurrencyCode = command.CurrencyCode,
         Available    = command.Available
     });
 }
Exemple #2
0
        public void ResetProduct(ResetProductCommand command)
        {
            if (command.Price != _price || command.CurrencyCode != _currencyCode)
            {
                ApplyChange(new ProductPriceChangedEvent(_id)
                {
                    Price        = command.Price,
                    CurrencyCode = command.CurrencyCode
                });
            }

            if (command.Available != _available)
            {
                ApplyChange(new ProductAvailabilityChangedEvent(_id)
                {
                    Available = command.Available,
                });
            }
        }