public static Product Create(string name, int quantity, decimal cost, ProductCode productCode) { return new Product() { Id = Guid.NewGuid(), Name = name, Quantity = quantity, Created = DateTime.Now, Modified = DateTime.Now, Active = true, Cost = cost, Code = productCode }; }
public static Product Create(Guid id, string name, int quantity, decimal cost, ProductCode productCode) { Product product = Create(name, quantity, cost, productCode); product.Id = id; return(product); }
public static Product Create(Guid id, string name, int quantity, decimal cost, ProductCode productCode) { Product product = Create(name, quantity, cost, productCode); product.Id = id; return product; }
public static Product Create(Guid id, string name, int quantity, decimal cost, ProductCode productCode) { Product product = new Product() { Id = id, Name = name, Quantity = quantity, Created = DateTime.Now, Modified = DateTime.Now, Active = true, Cost = cost, Code = productCode }; DomainEvents.Raise <ProductCreated>(new ProductCreated() { Product = product }); return(product); }
public static Product Create(string name, int quantity, decimal cost, ProductCode productCode) { return(Create(Guid.NewGuid(), name, quantity, cost, productCode)); }