Skip to content

CacheKeys class

Namespace: Vitreous.Caching
Assembly: Vitreous.Caching.dll

Helpers for building cache keys consistently across all backends.

public static class CacheKeys

object ← CacheKeys

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Joins prefix and key with exactly one ‘:’ separator. A prefix that already ends with ‘:’ is not doubled, and an empty prefix returns key unchanged.

public static string Combine(string? prefix, string key)

prefix string?

key string

string

CacheKeys.Combine("vitreous:", "order:1") // "vitreous:order:1"
CacheKeys.Combine("vitreous",  "order:1") // "vitreous:order:1"
CacheKeys.Combine("",          "order:1") // "order:1"