Class RedbDictionaryOrder

Namespace: redb.Core.Utils
Assembly: redb.Core.dll

The order in which a dictionary read from the database lists its entries: by key, the same on every provider and
in every read. A dictionary is stored as an unordered set (its hash ignores the order of entries), and a read used
to list them in the order of its rows (Pro) or of the JSON the free modules built (by key length on PostgreSQL, by
key text on SQL Server and SQLite), so the order moved between providers and, in Pro, between reads.
Simple keys sort by their value: strings ordinally, numbers, dates, times, Guids and enums as values, byte arrays
by their bytes. Composite keys (value tuples, classes) sort by the text they are stored under.

public static class RedbDictionaryOrder

Inheritance

Object→RedbDictionaryOrder

Methods

For(Type)

The comparer of keys of type keyType.

public static IComparer<object> For(Type keyType)

Sort<TKey, TValue>(List<KeyValuePair<TKey, TValue>>)

The entries in the order a read lists them.

public static List<KeyValuePair<TKey, TValue>> Sort<TKey, TValue>(List<KeyValuePair<TKey, TValue>> entries) where TKey : notnull