Click or drag to resize

ListExtensionsOrderByTElement, TKey Method

Sorts the elements of a sequence in ascending or descending order according to a key.

Namespace:  Ookii.Jumbo
Assembly:  Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 2.0.0
Syntax
public static IOrderedEnumerable<TElement> OrderBy<TElement, TKey>(
	this IEnumerable<TElement> source,
	Func<TElement, TKey> keySelector,
	bool ascending
)

Parameters

source
Type: System.Collections.GenericIEnumerableTElement
A sequence of values to order.
keySelector
Type: SystemFuncTElement, TKey
A function to extract a key from an element.
ascending
Type: SystemBoolean
to sort in ascending order; to sort in descending order.

Type Parameters

TElement
The type of the element of source.
TKey
The type of the key returned by keySelector.

Return Value

Type: IOrderedEnumerableTElement
An IOrderedEnumerableTElement whose elements are sorted according to a key.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableTElement. 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