public static void Demo() { List <ProductThree> products = ProductThree.GetSampleProducts(); foreach (ProductThree product in products.Where(p => p.Price == null)) { Console.WriteLine(product.Name); } }
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); } }
public static void DemoFour() { List <ProductThree> products = ProductThree.GetSampleProducts(); /* * foreach (ProductThree p in products.OrderBy(p1 => p1.Name))//Ask * { * Console.WriteLine(p); * } */ }