Ejemplo n.º 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;
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }