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
Type | Name |
---|---|
System.String | key |
Get<T>(String)
View Source
Declaration
public T Get<T>(string key)
Returns
<T>
Parameters
Type | Name |
---|---|
System.String | key |
Type Parameters
T
Increment(String, UInt32)
View Source
Declaration
public long Increment(string key, uint amount)
Returns
System.Int64
Parameters
Type | Name |
---|---|
System.String | key |
System.UInt32 | amount |
Decrement(String, UInt32)
View Source
Declaration
public long Decrement(string key, uint amount)
Returns
System.Int64
Parameters
Type | Name |
---|---|
System.String | key |
System.UInt32 | amount |
Add<T>(String, T)
View Source
Declaration
public bool Add<T>(string key, T value)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
Type Parameters
T
Set<T>(String, T)
View Source
Declaration
public bool Set<T>(string key, T value)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
Type Parameters
T
Replace<T>(String, T)
View Source
Declaration
public bool Replace<T>(string key, T value)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
Type Parameters
T
SetAll<T>(IDictionary<String, T>)
View Source
Declaration
public void SetAll<T>(IDictionary<string, T> values)
Parameters
Type | Name |
---|---|
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
Type | Name |
---|---|
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
Type | Name |
---|---|
System.String | key |
<T> | value |
System.TimeSpan | expiresIn |
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
Type | Name |
---|---|
System.String | key |
<T> | value |
System.TimeSpan | expiresIn |
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
Type | Name |
---|---|
System.String | key |
<T> | value |
System.TimeSpan | expiresIn |
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
Type | Name |
---|---|
System.String | key |
<T> | value |
System.DateTime | expiresAt |
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
Type | Name |
---|---|
System.String | key |
<T> | value |
System.DateTime | expiresAt |
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
Type | Name |
---|---|
System.String | key |
<T> | value |
System.DateTime | expiresAt |
Type Parameters
T
RemoveAll(IEnumerable<String>)
View Source
Declaration
public void RemoveAll(IEnumerable<string> keys)
Parameters
Type | Name |
---|---|
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
Type | Name |
---|---|
System.String | pattern |
RemoveByRegex(String)
View Source
Declaration
public void RemoveByRegex(string regex)
Parameters
Type | Name |
---|---|
System.String | regex |
GetKeysByPattern(String)
View Source
Declaration
public IEnumerable<string> GetKeysByPattern(string pattern)
Returns
System.Collections.Generic.IEnumerable<System.String>
Parameters
Type | Name |
---|---|
System.String | pattern |
RemoveExpiredEntries()
View Source
Declaration
public void RemoveExpiredEntries()
GetTimeToLive(String)
View Source
Declaration
public TimeSpan? GetTimeToLive(string key)
Returns
System.Nullable<System.TimeSpan>
Parameters
Type | Name |
---|---|
System.String | key |