Table of Contents

Method ThenByIdentity

Namespace
SodaFlow.Collections
Assembly
SodaFlow.Core.Collections.dll

ThenByIdentity<TSortKey>(Func<TIdentity, TSortKey>)

This order, with a second level for keys with equal sort values, by a value from the immutable part of each item only.

public KeyOrder<TKey, TIdentity, TState> ThenByIdentity<TSortKey>(Func<TIdentity, TSortKey> selector)

Parameters

selector Func<TIdentity, TSortKey>

Projects the next level's sort value from an identity.

Returns

KeyOrder<TKey, TIdentity, TState>

The refined order. This order does not change, and other code can use it alone.

Type Parameters

TSortKey

The type of the projected sort value.

Remarks

The refined order uses the identity only when this order also uses the identity only. One level that reads the state is sufficient to let a state edit move a key.

ThenByIdentity<TSortKey>(Func<TIdentity, TSortKey>, IComparer<TSortKey>, bool)

This order, with a second level for keys with equal sort values, by a value from the immutable part of each item only.

public KeyOrder<TKey, TIdentity, TState> ThenByIdentity<TSortKey>(Func<TIdentity, TSortKey> selector, IComparer<TSortKey> sortComparer, bool isDescending)

Parameters

selector Func<TIdentity, TSortKey>

Projects the next level's sort value from an identity.

sortComparer IComparer<TSortKey>

Compares two of the next level's sort values.

isDescending bool

True when this level uses the opposite direction, at each direction of the levels above it.

Returns

KeyOrder<TKey, TIdentity, TState>

The refined order. This order does not change, and other code can use it alone.

Type Parameters

TSortKey

The type of the projected sort value.