在C#中使用OrderByDescending可以對集合中的元素進行降序排序。以下是一些小技巧來使用OrderByDescending:
var sortedList = myList.OrderByDescending(x => x.PropertyName).ToList();
var sortedList = (from item in myList
orderby item.PropertyName descending
select item).ToList();
var sortedList = myList.OrderByDescending(x => x.Property1).ThenByDescending(x => x.Property2).ToList();
var sortedList = myList.OrderByDescending(x => x, new CustomComparer()).ToList();