Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
 private void ApplyProductPriceChangedEvent(ProductPriceChangedEvent e)
 {
     Price = ProductPrice.FromMoney(e.Price);
     SetStatus();
     LastUpdateDate = DateTime.UtcNow;
 }