Enumerable.OrderDescending Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
OrderDescending<T>(IEnumerable<T>, IComparer<T>) |
Sorts the elements of a sequence in descending order. |
OrderDescending<T>(IEnumerable<T>) |
Sorts the elements of a sequence in descending order. |
OrderDescending<T>(IEnumerable<T>, IComparer<T>)
- Source:
- OrderBy.cs
- Source:
- OrderBy.cs
- Source:
- OrderBy.cs
Sorts the elements of a sequence in descending order.
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)
Type Parameters
- T
The type of the elements of source
.
Parameters
- source
- IEnumerable<T>
A sequence of values to order.
- comparer
- IComparer<T>
An IComparer<T> to compare keys.
Returns
An IOrderedEnumerable<TElement> whose elements are sorted.
Exceptions
source
is null
.
Remarks
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated by calling its <see cref="M:System.Collections.Generic.IEnumerable`1.GetEnumerator> method.
If comparer is null
, the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default> is used to compare elements.
Applies to
OrderDescending<T>(IEnumerable<T>)
- Source:
- OrderBy.cs
- Source:
- OrderBy.cs
- Source:
- OrderBy.cs
Sorts the elements of a sequence in descending order.
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)
Type Parameters
- T
The type of the elements of source
.
Parameters
- source
- IEnumerable<T>
A sequence of values to order.
Returns
An IOrderedEnumerable<TElement> whose elements are sorted.
Exceptions
source
is null
.
Remarks
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated by calling its <see cref="M:System.Collections.Generic.IEnumerable`1.GetEnumerator> method.
This method compares elements by using the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default>.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기