Class CacheHelper
Represents cache helper.
Inheritance
System.Object
CacheHelper
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Engine.Caching
Assembly: Mediachase.Commerce.dll
Version: 10.8.0Syntax
public class CacheHelper
Constructors
CacheHelper()
Declaration
public CacheHelper()
Methods
Clear(String)
Removes all items from the Cache
Declaration
public static void Clear(string prefix)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix. |
CreateCacheKey(String, String[])
Creates the cache key.
Declaration
public static string CreateCacheKey(string prefix, params string[] keys)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix. |
System.String[] | keys | The keys. |
Returns
Type | Description |
---|---|
System.String |
Get(String)
Gets the specified key.
Declaration
public static object Get(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Object |
GetLock(String)
Gets the lock.
Declaration
public static object GetLock(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Object |
Insert(String, Object, TimeSpan)
Inserts the specified key.
Declaration
public static void Insert(string key, object obj, TimeSpan timespan)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Object | obj | The obj. |
System.TimeSpan | timespan | The timespan. |
Insert(String, Object, TimeSpan, CacheItemPriority)
Inserts the specified key.
Declaration
public static void Insert(string key, object obj, TimeSpan timespan, CacheItemPriority priority)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Object | obj | The obj. |
System.TimeSpan | timespan | The timespan. |
System.Web.Caching.CacheItemPriority | priority | The priority. |
Insert(String, Object, CacheDependency, TimeSpan)
Inserts the specified key.
Declaration
public static void Insert(string key, object obj, CacheDependency dep, TimeSpan timespan)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Object | obj | The obj. |
System.Web.Caching.CacheDependency | dep | The dep. |
System.TimeSpan | timespan | The timespan. |
Insert(String, Object, CacheDependency, TimeSpan, CacheItemPriority)
Inserts the specified key.
Declaration
public static void Insert(string key, object obj, CacheDependency dep, TimeSpan timeframe, CacheItemPriority priority)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Object | obj | The obj. |
System.Web.Caching.CacheDependency | dep | The dep. |
System.TimeSpan | timeframe | The timeframe. |
System.Web.Caching.CacheItemPriority | priority | The priority. |
Insert(String, Object, CacheDependency, TimeSpan, CacheItemPriority, CacheItemRemovedCallback)
Inserts the specified key.
Declaration
public static void Insert(string key, object obj, CacheDependency dep, TimeSpan timeframe, CacheItemPriority priority, CacheItemRemovedCallback callback)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Object | obj | The obj. |
System.Web.Caching.CacheDependency | dep | The dep. |
System.TimeSpan | timeframe | The timeframe. |
System.Web.Caching.CacheItemPriority | priority | The priority. |
System.Web.Caching.CacheItemRemovedCallback | callback | The callback. |
Remove(String)
Removes the specified key from the cache
Declaration
public static void Remove(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
RemoveByPattern(String)
Removes the cache by pattern.
Declaration
public static void RemoveByPattern(string pattern)
Parameters
Type | Name | Description |
---|---|---|
System.String | pattern | The pattern. |