コード例 #1
0
        public static void Demo()
        {
            List <ProductThree> products = ProductThree.GetSampleProducts();

            foreach (ProductThree product in products.Where(p => p.Price == null))
            {
                Console.WriteLine(product.Name);
            }
        }
コード例 #2
0
        public static void DemoThree()
        {
            List <ProductThree> products = ProductThree.GetSampleProducts();

            products.Sort((x, y) => x.Name.CompareTo(y.Name));
            foreach (ProductThree p in products)
            {
                Console.WriteLine(p);
            }
        }
コード例 #3
0
        public static void DemoFour()
        {
            List <ProductThree> products = ProductThree.GetSampleProducts();

            /*
             * foreach (ProductThree p in products.OrderBy(p1 => p1.Name))//Ask
             * {
             *  Console.WriteLine(p);
             * }
             */
        }