Class RedbKeySerializer
Serializes and deserializes Dictionary keys to/from _array_index (text) storage.
Simple keys (string, int, Guid, etc.) are serialized directly.
Complex keys (Tuple, custom classes) are serialized to Base64-encoded JSON.
public static class RedbKeySerializer
Inheritance
Methods
Deserialize<TKey>(string)
Deserialize _array_index text value to key
public static TKey Deserialize<TKey>(string arrayIndex)
DeserializeObject(string, Type)
Deserialize _array_index text value to key (non-generic version)
public static object? DeserializeObject(string arrayIndex, Type keyType)
GetKeyTypeId(Type)
Get RedbTypeIds constant for key type
public static long GetKeyTypeId(Type keyType)
IsComplexKey(Type)
Check if key type is a complex type requiring JSON serialization
public static bool IsComplexKey(Type keyType)
Serialize<TKey>(TKey)
Serialize key to _array_index text value
public static string Serialize<TKey>(TKey key)
SerializeObject(object, Type)
Serialize key to _array_index text value (non-generic version)
public static string SerializeObject(object key, Type keyType)