ascending(C# 参考)

ascending 上下文关键字用在查询表达式的 orderby 子句中,用于指定从最小到最大的排序顺序。因为 ascending 是默认排序顺序,所以您无须指定它。

下面的示例演示 ascendingorderby 子句中的用法。

IEnumerable<string> sortAscendingQuery =
    from vegetable in vegetables
    orderby vegetable ascending
    select vegetable;

请参阅

C# 参考

LINQ 查询表达式(C# 编程指南)

descending(C# 参考)