コード例 #1
0
        public static void Main()
        {
            var customer = new Customer();
            customer
                .FirstName("John")
                .LastName("Snow")
                .Gender("Undying")
                .Address("The Wild");
            Console.WriteLine(customer.ToString());

            Console.WriteLine(new string('-', 60));

            var customerTwo = new Customer();
            customerTwo
                .FirstName("Maria")
                .Gender("Female");
            Console.WriteLine(customerTwo.ToString());

            Console.WriteLine(new string('-', 60));

            var customer2 = new Customer();
            customer2
                .FirstName("John2")
                .LastName("Snow2")
                .Gender("Undying2")
                .Address("The Wild2");

            var all = new List<Customer>() { customer2, customer };

            Console.WriteLine(all[0].ToString());
        }
コード例 #2
0
        public static void Main()
        {
            Enumerable.Range(0, 11)
                .Where(x => x % 2 == 0)
                .Select(x => x * x).ToList()
                .ForEach(Console.WriteLine);

            Console.WriteLine(new string('-', 60));

            var customer = new Customer();
            customer.FirstName("Nikolay").LastName("Kostov")
                .Gender("Male").Address("Sofia")
                .PrintToConsole();
        }