Beispiel #1
0
 public void Edit(int categoryId, string name, string description, Price price, string imageUrl)
 {
     this.CategoryId = categoryId;
     this.Name = name;
     this.Description = description;
     this.Price = price;
     this.ImageUrl = imageUrl;
 }
Beispiel #2
0
        public Product(int categoryId, string name, string description, string imageUrl, Price price, int? id = null)
        {
            this.CategoryId = categoryId;
            this.Name = name;
            this.Description = description;
            this.ImageUrl = imageUrl;
            this.Price = price;

            this.Id = id ?? 0;
        }
Beispiel #3
0
        public Product(int categoryId, string name, string description, string imageUrl, Price price)
        {
            price.ValidateNotNullParameter("price");

            this.CategoryId = categoryId;
            this.Name = name;
            this.Description = description;
            this.ImageUrl = imageUrl;
            this.ExactPrice = price.ExactPrice;
            this.FromPrice = price.FromPrice;
            this.ToPrice = price.ToPrice;
        }
Beispiel #4
0
        private static Price GetPrice(Db.Product db)
        {
            Price price = null;

            if (db.ExactPrice.HasValue)
            {
                price = new Price(db.ExactPrice.Value);
            }
            else if (db.FromPrice.HasValue && db.ToPrice.HasValue)
            {
                price = new Price(db.FromPrice.Value, db.ToPrice.Value);
            }

            return price;
        }