Method SortByKey
- Namespace
- SodaFlow.Collections
- Assembly
- SodaFlow.Collections.dll
SortByKey<TKey, TIdentity, TState>(ReactiveCollection<TKey, TIdentity, TState>)
Reorders by key, over any stage.
public static ReactiveCollection<TKey, TIdentity, TState> SortByKey<TKey, TIdentity, TState>(this ReactiveCollection<TKey, TIdentity, TState> upstream) where TKey : notnull where TIdentity : notnull
Parameters
upstreamReactiveCollection<TKey, TIdentity, TState>The collection or view to reorder.
Returns
- ReactiveCollection<TKey, TIdentity, TState>
A view of
upstreamordered by key.
Type Parameters
TKeyThe type of the keys.
TIdentityThe type of the immutable part of an item.
TStateThe type of the mutable part of an item.
SortByKey<TKey, TIdentity, TState>(ReactiveCollection<TKey, TIdentity, TState>, IComparer<TKey>, bool)
Reorders by key, over any stage, with an explicit comparer.
public static ReactiveCollection<TKey, TIdentity, TState> SortByKey<TKey, TIdentity, TState>(this ReactiveCollection<TKey, TIdentity, TState> upstream, IComparer<TKey> keyComparer, bool isDescending) where TKey : notnull where TIdentity : notnull
Parameters
upstreamReactiveCollection<TKey, TIdentity, TState>The collection or view to reorder.
keyComparerIComparer<TKey>The comparer to order keys by.
isDescendingboolTrue when the sort uses the opposite direction.
Returns
- ReactiveCollection<TKey, TIdentity, TState>
A view of
upstreamordered by key.
Type Parameters
TKeyThe type of the keys.
TIdentityThe type of the immutable part of an item.
TStateThe type of the mutable part of an item.