MoreEnumerable.ThenBy<T, TKey> Method (IOrderedEnumerable<T>, Func<T, TKey>, OrderByDirection) |
Performs a subsequent ordering of elements in a sequence in a particular direction (ascending, descending) according to a key
Namespace:
MoreLinq
Assembly:
MoreLinq (in MoreLinq.dll) Version: 2.10.0
Syntaxpublic static IOrderedEnumerable<T> ThenBy<T, TKey>(
this IOrderedEnumerable<T> source,
Func<T, TKey> keySelector,
OrderByDirection direction
)
<ExtensionAttribute>
Public Shared Function ThenBy(Of T, TKey) (
source As IOrderedEnumerable(Of T),
keySelector As Func(Of T, TKey),
direction As OrderByDirection
) As IOrderedEnumerable(Of T)
public:
[ExtensionAttribute]
generic<typename T, typename TKey>
static IOrderedEnumerable<T>^ ThenBy(
IOrderedEnumerable<T>^ source,
Func<T, TKey>^ keySelector,
OrderByDirection direction
)
[<ExtensionAttribute>]
static member ThenBy :
source : IOrderedEnumerable<'T> *
keySelector : Func<'T, 'TKey> *
direction : OrderByDirection -> IOrderedEnumerable<'T>
Parameters
- source
- Type: System.Linq.IOrderedEnumerable<T>
The sequence to order - keySelector
- Type: System.Func<T, TKey>
A key selector function - direction
- Type: MoreLinq.OrderByDirection
A direction in which to order the elements (ascending, descending)
Type Parameters
- T
- The type of the elements in the source sequence
- TKey
- The type of the key used to order elements
Return Value
Type:
IOrderedEnumerable<T>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
IOrderedEnumerable<T>. 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