Enumerable.Order Metoda

Definicja

Przeciążenia

Order<T>(IEnumerable<T>)

Sortuje elementy sekwencji w kolejności rosnącej.

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

Sortuje elementy sekwencji w kolejności rosnącej.

Order<T>(IEnumerable<T>)

Źródło:
OrderBy.cs
Źródło:
OrderBy.cs
Źródło:
OrderBy.cs

Sortuje elementy sekwencji w kolejności rosnącej.

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

Parametry typu

T

Typ elementów elementu source.

Parametry

source
IEnumerable<T>

Sekwencja wartości do ustawienia w kolejności.

Zwraca

Element, którego IOrderedEnumerable<TElement> elementy są sortowane.

Wyjątki

source to null.

Uwagi

Ta metoda jest implementowana za pomocą odroczonego wykonania. Bezpośrednio zwracana wartość jest obiektem, który przechowuje wszystkie informacje wymagane do wykonania akcji. Zapytanie reprezentowane przez tę metodę nie jest wykonywane, dopóki obiekt nie zostanie wyliczony przez wywołanie metody <cref="M:System.Collections.Generic.IEnumerable'1.GetEnumerator> .

Ta metoda porównuje elementy przy użyciu domyślnego porównywacza <, zobacz cref="P:System.Collections.Generic.Comparer'1.Default>.

Dotyczy

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

Źródło:
OrderBy.cs
Źródło:
OrderBy.cs
Źródło:
OrderBy.cs

Sortuje elementy sekwencji w kolejności rosnącej.

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

Parametry typu

T

Typ elementów elementu source.

Parametry

source
IEnumerable<T>

Sekwencja wartości do ustawienia w kolejności.

comparer
IComparer<T>

Element do IComparer<T> porównywania kluczy.

Zwraca

Element, którego IOrderedEnumerable<TElement> elementy są sortowane.

Wyjątki

source to null.

Uwagi

Ta metoda jest implementowana za pomocą odroczonego wykonania. Bezpośrednio zwracana wartość jest obiektem, który przechowuje wszystkie informacje wymagane do wykonania akcji. Zapytanie reprezentowane przez tę metodę nie jest wykonywane, dopóki obiekt nie zostanie wyliczony przez wywołanie metody <cref="M:System.Collections.Generic.IEnumerable'1.GetEnumerator> .

Jeśli parametr comparer to null, domyślny porównujący <zobacz cref="P:System.Collections.Generic.Comparer'1.Default> jest używany do porównywania elementów.

Dotyczy