Exemple #1
0
        public static Product Create(PlainText name, Quantity quantity, Cost cost, ProductCode productCode, PlainText description, string image)
        {
            Product product = new Product()
            {
                Id          = Guid.NewGuid(),
                Name        = name,
                Quantity    = quantity,
                Created     = DateTime.Now,
                Modified    = DateTime.Now,
                Active      = true,
                Cost        = cost,
                Code        = productCode,
                Description = description,
                Image       = image
            };

            DomainEvents.Raise <ProductCreated>(new ProductCreated(product));
            return(product);
        }
 public ProductCodeCreated(ProductCode productCode)
 {
     this.Args.Add("Cpde", productCode.Name);
 }