descending(C# 参考)descending (C# Reference)

查询表达式中的 orderby 子句中使用 descending 上下文关键字指定排序顺序为从大到小。The descending contextual keyword is used in the orderby clause in query expressions to specify that the sort order is from largest to smallest.

示例Example

下面的示例说明 descendingorderby 子句中的用法。The following example shows the use of descending in an orderby clause.

IEnumerable<string> sortDescendingQuery =
    from vegetable in vegetables
    orderby vegetable descending
    select vegetable;

请参阅See also