Enumerable.OrderDescending 方法

定义

重载

OrderDescending<T>(IEnumerable<T>, IComparer<T>)

按降序对序列的元素排序。

OrderDescending<T>(IEnumerable<T>)

按降序对序列的元素排序。

OrderDescending<T>(IEnumerable<T>, IComparer<T>)

Source:
OrderBy.cs
Source:
OrderBy.cs
Source:
OrderBy.cs

按降序对序列的元素排序。

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::IOrderedEnumerable<T> ^ OrderDescending(System::Collections::Generic::IEnumerable<T> ^ source, System::Collections::Generic::IComparer<T> ^ comparer);
public static System.Linq.IOrderedEnumerable<T> OrderDescending<T> (this System.Collections.Generic.IEnumerable<T> source, System.Collections.Generic.IComparer<T>? comparer);
static member OrderDescending : seq<'T> * System.Collections.Generic.IComparer<'T> -> System.Linq.IOrderedEnumerable<'T>
<Extension()>
Public Function OrderDescending(Of T) (source As IEnumerable(Of T), comparer As IComparer(Of T)) As IOrderedEnumerable(Of T)

类型参数

T

source 的元素类型。

参数

source
IEnumerable<T>

一个要排序的值序列。

comparer
IComparer<T>

用于比较键的 IComparer<T>

返回

对其 IOrderedEnumerable<TElement> 元素进行排序的 。

例外

sourcenull

注解

此方法通过使用延迟执行来实现。 即时返回值是一个对象,用于存储执行操作所需的所有信息。 在通过调用 <对象 see cref=“M:System.Collections.Generic.IEnumerable'1.GetEnumerator> 方法枚举对象之前,不会执行此方法表示的查询。

如果 comparer 为 null,则默认比较器 <请参阅 cref=“P:System.Collections.Generic.Comparer'1.Default> 用于比较元素。

适用于

OrderDescending<T>(IEnumerable<T>)

Source:
OrderBy.cs
Source:
OrderBy.cs
Source:
OrderBy.cs

按降序对序列的元素排序。

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::IOrderedEnumerable<T> ^ OrderDescending(System::Collections::Generic::IEnumerable<T> ^ source);
public static System.Linq.IOrderedEnumerable<T> OrderDescending<T> (this System.Collections.Generic.IEnumerable<T> source);
static member OrderDescending : seq<'T> -> System.Linq.IOrderedEnumerable<'T>
<Extension()>
Public Function OrderDescending(Of T) (source As IEnumerable(Of T)) As IOrderedEnumerable(Of T)

类型参数

T

source 的元素类型。

参数

source
IEnumerable<T>

一个要排序的值序列。

返回

对其 IOrderedEnumerable<TElement> 元素进行排序的 。

例外

sourcenull

注解

此方法通过使用延迟执行来实现。 即时返回值是一个对象,用于存储执行操作所需的所有信息。 在通过调用 <对象 see cref=“M:System.Collections.Generic.IEnumerable'1.GetEnumerator> 方法枚举对象之前,不会执行此方法表示的查询。

此方法使用默认比较器 <比较元素,请参阅 cref=“P:System.Collections.Generic.Comparer'1.Default>。

适用于