Using system; using system. collections. generic; using system. LINQ; using system. text; namespace listsort {class program {static void main (string [] ARGs) {list <customer> listcustomer = new list <customer> (); listcustomer. add (new customer {name = "Customer 1", id = 0}); listcustomer. add (new customer {name = "Customer 2", id = 1}); listcustomer. add (new customer {name = "Customer 3", id = 5}); listcustomer. add (new customer {name = "Customer 4", id = 3}); listcustomer. add (new customer {name = "customer 5", id = 4}); listcustomer. add (new customer {name = "customer 6", id = 5}); // list in ascending order <customer> listcustomer1 = listcustomer. orderby (S => S. ID ). tolist <customer> (); // list in descending order <customer> listcustomer2 = listcustomer. orderbydescending (S => S. ID ). tolist <customer> (); // list of LINQ sorting methods <customer> listcustomer3 = (from C in listcustomer orderby C. id descending // ascending select C ). tolist <customer> (); console. writeline ("list. orderby method Ascending Order "); foreach (customer in listcustomer1) {console. writeline (customer. name);} console. writeline ("list. orderbydescending method "); foreach (customer in listcustomer2) {console. writeline (customer. name);} console. writeline ("sorting in descending order of the LINQ method"); foreach (customer in listcustomer3) {console. writeline (customer. name);} console. readkey () ;}} Class Customer {public int ID {Get; Set ;}public string name {Get; Set ;}}}