Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Linq30()
- {
- List<Product> products = GetProductList();
- var sortedProducts =
- from prod in products
- orderby prod.ProductName
- select prod;
- ObjectDumper.Write(sortedProducts);
- }
- public void Linq32()
- {
- double[] doubles = { 1.7, 2.3, 1.9, 4.1, 2.9 };
- var sortedDoubles =
- from d in doubles
- orderby d descending
- select d;
- Console.WriteLine("The doubles from highest to lowest:");
- foreach (var d in sortedDoubles)
- {
- Console.WriteLine(d);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment