Click or drag to resize

MoreEnumerableOrderByT, TKey Method (IEnumerableT, FuncT, TKey, OrderByDirection)

Sorts the elements of a sequence in a particular direction (ascending, descending) according to a key

Namespace:  MoreLinq
Assembly:  MoreLinq (in MoreLinq.dll) Version: 2.4.0
public static IOrderedEnumerable<T> OrderBy<T, TKey>(
	this IEnumerable<T> source,
	Func<T, TKey> keySelector,
	OrderByDirection direction


Type: System.Collections.GenericIEnumerableT
The sequence to order
Type: SystemFuncT, TKey
A key selector function
Type: MoreLinqOrderByDirection
A direction in which to order the elements (ascending, descending)

Type Parameters

The type of the elements in the source sequence
The type of the key used to order elements

Return Value

Type: IOrderedEnumerableT
An ordered copy of the source sequence

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also