Exemplo n.º 1
0
        public static Product Create(Guid id, string name, int quantity, decimal cost, ProductCode productCode)
        {
            var product = new Product
            {
                Id       = id,
                Name     = name,
                Quantity = quantity,
                Created  = DateTime.Now,
                Modified = DateTime.Now,
                Active   = true,
                Cost     = cost,
                Code     = productCode
            };

            DomainEvents.Raise(new ProductCreated(product));
            return(product);
        }
Exemplo n.º 2
0
 public static Product Create(string name, int quantity, decimal cost, ProductCode productCode)
 {
     return(Create(Guid.NewGuid(), name, quantity, cost, productCode));
 }