コード例 #1
0
ファイル: Program.cs プロジェクト: OsvaldoMartini/DI_Projects
        private static void Main(string[] args)
        {
            Debug.WriteLine("Abstraction Example");
            Debug.WriteLine("");

            var orderInfo = new OrderInfo
            {
                CustomerName = "Claudia Almeida",
                Email        = "*****@*****.**",
                Product      = "LCD Monitor Smart Samsung",
                Price        = 259.00f,
                CreditCard   = "1234.5678.9876.5432"
            };

            Debug.WriteLine("Production");
            Debug.WriteLine("");

            var commerce = new Commerce();

            commerce.ProcessOrder(orderInfo);

            Console.WriteLine("");
            Console.WriteLine("Press [Enter] to exit...");
            Console.WriteLine("");
        }
コード例 #2
0
        static void Main(string[] args)
        {
            var orderInfo = new OrderInfo
            {
                CustomerName = "Rachid Lamtabbet",
                CreditCard   = "12457845125464721",
                Price        = 119.99,
                Product      = "Kindel WhitePaper 2"
            };

            var commerce = new Commerce(new BillingProcessor(),
                                        new Customer(),
                                        new Notifier(),
                                        new Logger());

            commerce.ProcessOrder(orderInfo);

            Console.Read();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: jimxshaw/vslive2017
        static void Main(string[] args)
        {
            Console.WriteLine("COUPLED Example");
            Console.WriteLine();

            OrderInfo orderInfo = new OrderInfo()
            {
                CustomerName = "Miguel Castro",
                Email        = "*****@*****.**",
                Product      = "Laptop",
                Price        = 1200,
                CreditCard   = "1234567890"
            };

            Commerce commerce = new Commerce();

            commerce.ProcessOrder(orderInfo);

            Console.WriteLine();
            Console.WriteLine("Press [Enter] to exit...");
            Console.ReadLine();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: tleviathan/DeepDiveIntoDI
        static void Main(string[] args)
        {
            Console.WriteLine("COUPLED Example");
            Console.WriteLine();

            OrderInfo orderInfo = new OrderInfo()
            {
                CustomerName = "Miguel Castro",
                Email = "*****@*****.**",
                Product = "Laptop",
                Price = 1200,
                CreditCard = "1234567890"
            };

            Commerce commerce = new Commerce();

            commerce.ProcessOrder(orderInfo);

            Console.WriteLine();
            Console.WriteLine("Press [Enter] to exit...");
            Console.ReadLine();
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: anilsathe21/Training-1
        static void Main(string[] args)
        {
            var orderInfo = new OrderInfo
            {
                CustomerName = "Prasad Honrao",
                Email        = "*****@*****.**",
                Product      = "iPad",
                Price        = 499,
                CreditCard   = 123456
            };

            var commerce = new Commerce(new BillingProcessor(),
                                        new CustomerProcessor(),
                                        new Notifier(),
                                        new Logger());

            commerce.ProcessOrder(orderInfo);

            Console.WriteLine("Order processed successfully");

            Console.ReadLine();
        }