Exemplo n.º 1
0
 public void Handle(ProductInsertedEvent @event)
 {
     AddedBy            = @event.AddedBy;
     AddedDate          = @event.AddedDate;
     Id                 = @event.AggregateId;
     DepartmentId       = @event.DepartmentId;
     Description        = @event.Description;
     DiscountPercentage = @event.DiscountPercentage;
     FullImageUrl       = @event.FullImageUrl;
     SKU                = @event.SKU;
     SmallImageUrl      = @event.SmallImageUrl;
     Title              = @event.Title;
     TotalRating        = @event.TotalRating;
     UnitPrice          = @event.UnitPrice;
     UnitsInStock       = @event.UnitsInStock;
     Votes              = @event.Votes;
 }
Exemplo n.º 2
0
        public Product(
            Guid Id,
            DateTime AddedDate,
            string AddedBy,
            Guid DepartmentId,
            string Title,
            string Description,
            string SKU,
            decimal UnitPrice,
            int DiscountPercentage,
            int UnitsInStock,
            string SmallImageUrl,
            string FullImageUrl,
            int Votes,
            int TotalRating)
        {
            var @event = new ProductInsertedEvent
            {
                AggregateId        = Id,
                AddedDate          = AddedDate,
                AddedBy            = AddedBy,
                DepartmentId       = DepartmentId,
                Title              = Title,
                Description        = Description,
                SKU                = SKU,
                UnitPrice          = UnitPrice,
                DiscountPercentage = DiscountPercentage,
                UnitsInStock       = UnitsInStock,
                SmallImageUrl      = SmallImageUrl,
                FullImageUrl       = FullImageUrl,
                Votes              = Votes,
                TotalRating        = TotalRating
            };

            ApplyChange(@event);
        }