ascending (C# 參考)

在查詢運算式的 orderby 子句ascending中使用內容關鍵字,指定由小到大的排序次序。 因為 ascending 是預設的排序次序,所以不必指定它。

範例

下列範例示範 orderby 子句ascending 的用法。

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

另請參閱