Example #1
0
        public void Create(ProductName name, ProductBrand brand, ProductCategory category, ProductPacking packing, decimal price
                           , bool refrigerated, DateTime expirationDate, double weight, string description, decimal totalPrice)
        {
            var product = new Product()
            {
                Name           = name.GetValue(),
                Brand          = brand.GetValue(),
                CategoryId     = category.GetValue(),
                PackingTypeId  = packing.GetValue(),
                Price          = price,
                Refrigerated   = refrigerated,
                ExpirationDate = expirationDate,
                Weight         = weight,
                Description    = description,
                TotalPrice     = totalPrice
            };

            Repository.Save(product);
        }