private static void SortingC3V2() { List <ProductC3> products = ProductC3.GetSampleProducts(); foreach (ProductC3 product in products.OrderBy(p => p.Name)) { Console.WriteLine(product); } }
private static void SortingC3V1() { List <ProductC3> products = ProductC3.GetSampleProducts(); products.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.CurrentCulture)); foreach (ProductC3 product in products) { Console.WriteLine(product); } }