Ejemplo n.º 1
0
        public Product CreateProductFor(PriceMethodEnum priceMethod, string name, decimal price, decimal weight)
        {
            var product = GetProductStrategy(priceMethod, name, price);

            product.Weight = weight;

            return(product);
        }
Ejemplo n.º 2
0
        public Product CreateProductFor(PriceMethodEnum priceMethod, string name, decimal price, int quantity)
        {
            var product = GetProductStrategy(priceMethod, name, price);

            product.Quantity = quantity;

            return(product);
        }
Ejemplo n.º 3
0
        private Product GetProductStrategy(PriceMethodEnum priceMethodEnum, string name, decimal price)
        {
            var product = strategies[priceMethodEnum]();

            product.PricingMethod = priceMethodEnum;
            product.ProductName   = name;
            product.Price         = price;
            return(product);
        }