static void Main(string[] args)
        {
            ProductFactory prod = new ProductFactory();
            IFactory       factory;

            for (int i = 0; i < 12; i++)
            {
                factory = prod.GetProduct(i);
                Console.WriteLine("Avogado for Month : " + i + " --> " + factory.ShippedFrom());
            }

            Console.ReadLine();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            IProduct product = ProductFactory.GetProduct("Smartphone", 20000, 10);

            product.GetProductType();
            product.GetHashCode();
            product.GetPrice();
            product.GetDiscount();

            IProduct product2 = ProductFactory.GetProduct("Laptop", 50000, 15);

            product2.GetProductType();
            product2.GetHashCode();
            product2.GetPrice();
            product2.GetDiscount();

            Console.ReadKey();
        }