Example #1
0
        private void ApplyProductCreatedEvent(ProductCreatedEvent e)
        {
            if (e.AggregateId == Guid.Empty)
            {
                throw new ArgumentNullException(nameof(Id));
            }

            Id        = e.AggregateId;
            Code      = new ProductCode(e.Code);
            Name      = new ProductName(e.Name);
            Price     = ProductPrice.FromMoney(e.Price);
            PhotoName = e.PhotoName;
            SetStatus();
        }
Example #2
0
 private void ApplyProductPriceChangedEvent(ProductPriceChangedEvent e)
 {
     Price = ProductPrice.FromMoney(e.Price);
     SetStatus();
     LastUpdateDate = DateTime.UtcNow;
 }