Skip to main content

CacheClientWithPrefix

Decorates the ICacheClient (and its siblings) prefixing every key with the given prefix

Useful for multi-tenant environments

Assembly: ServiceStack.dll
View Source
Declaration
public class CacheClientWithPrefix : ICacheClientExtended, ICacheClient, IDisposable, IRemoveByPattern

Properties

Prefix

View Source
Declaration
public string Prefix { get; }

Methods

Remove(String)

View Source
Declaration
public bool Remove(string key)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey

Get<T>(String)

View Source
Declaration
public T Get<T>(string key)
Returns

<T>

Parameters
TypeName
System.Stringkey
Type Parameters
  • T

Increment(String, UInt32)

View Source
Declaration
public long Increment(string key, uint amount)
Returns

System.Int64

Parameters
TypeName
System.Stringkey
System.UInt32amount

Decrement(String, UInt32)

View Source
Declaration
public long Decrement(string key, uint amount)
Returns

System.Int64

Parameters
TypeName
System.Stringkey
System.UInt32amount

Add<T>(String, T)

View Source
Declaration
public bool Add<T>(string key, T value)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
Type Parameters
  • T

Set<T>(String, T)

View Source
Declaration
public bool Set<T>(string key, T value)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
Type Parameters
  • T

Replace<T>(String, T)

View Source
Declaration
public bool Replace<T>(string key, T value)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
Type Parameters
  • T

SetAll<T>(IDictionary<String, T>)

View Source
Declaration
public void SetAll<T>(IDictionary<string, T> values)
Parameters
TypeName
System.Collections.Generic.IDictionary<System.String,<T>>values
Type Parameters
  • T

GetAll<T>(IEnumerable<String>)

View Source
Declaration
public IDictionary<string, T> GetAll<T>(IEnumerable<string> keys)
Returns

System.Collections.Generic.IDictionary<System.String,<T>>

Parameters
TypeName
System.Collections.Generic.IEnumerable<System.String>keys
Type Parameters
  • T

Replace<T>(String, T, TimeSpan)

View Source
Declaration
public bool Replace<T>(string key, T value, TimeSpan expiresIn)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
System.TimeSpanexpiresIn
Type Parameters
  • T

Set<T>(String, T, TimeSpan)

View Source
Declaration
public bool Set<T>(string key, T value, TimeSpan expiresIn)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
System.TimeSpanexpiresIn
Type Parameters
  • T

Add<T>(String, T, TimeSpan)

View Source
Declaration
public bool Add<T>(string key, T value, TimeSpan expiresIn)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
System.TimeSpanexpiresIn
Type Parameters
  • T

Replace<T>(String, T, DateTime)

View Source
Declaration
public bool Replace<T>(string key, T value, DateTime expiresAt)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
System.DateTimeexpiresAt
Type Parameters
  • T

Set<T>(String, T, DateTime)

View Source
Declaration
public bool Set<T>(string key, T value, DateTime expiresAt)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
System.DateTimeexpiresAt
Type Parameters
  • T

Add<T>(String, T, DateTime)

View Source
Declaration
public bool Add<T>(string key, T value, DateTime expiresAt)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
System.DateTimeexpiresAt
Type Parameters
  • T

RemoveAll(IEnumerable<String>)

View Source
Declaration
public void RemoveAll(IEnumerable<string> keys)
Parameters
TypeName
System.Collections.Generic.IEnumerable<System.String>keys

FlushAll()

View Source
Declaration
public void FlushAll()

Dispose()

View Source
Declaration
public void Dispose()

RemoveByPattern(String)

View Source
Declaration
public void RemoveByPattern(string pattern)
Parameters
TypeName
System.Stringpattern

RemoveByRegex(String)

View Source
Declaration
public void RemoveByRegex(string regex)
Parameters
TypeName
System.Stringregex

GetKeysByPattern(String)

View Source
Declaration
public IEnumerable<string> GetKeysByPattern(string pattern)
Returns

System.Collections.Generic.IEnumerable<System.String>

Parameters
TypeName
System.Stringpattern

RemoveExpiredEntries()

View Source
Declaration
public void RemoveExpiredEntries()

GetTimeToLive(String)

View Source
Declaration
public TimeSpan? GetTimeToLive(string key)
Returns

System.Nullable<System.TimeSpan>

Parameters
TypeName
System.Stringkey

Implements