示例#1
0
        static void Main(string[] args)
        {
            var mortgage = new Mortgage();

            var customer = new Customer("Ann McKinsey");

            var eligible = mortgage.IsEligible(customer, 125000);

            Console.WriteLine("\n" + customer.Name + " has been " + (eligible ? "Approved" : "Rejected"));
            Console.ReadKey();
        }
示例#2
0
        static void Main()
        {
            // Facade
            var mortgage = new Mortgage();

            var customer = new Customer {
                Name = "Lisa Johnson"
            };

            // Evaluate mortgage eligibility for customer
            var eligible = mortgage.IsEligible(customer, 125000);

            Console.WriteLine("{0} has been {1}", customer.Name, eligible ? "Approved" : "Rejected");

            Console.Write("Done.");
            Console.ReadLine();
        }