Try our conversational search powered by Generative AI!

Class OrderCache

Implements operations for the order cache.

Inheritance
System.Object
OrderCache
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.Orders
Assembly: Mediachase.Commerce.dll
Version: 10.8.0
Syntax
public sealed class OrderCache

Constructors

OrderCache()

Declaration
public OrderCache()

Methods

Clear()

Removes all items from the Cache

Declaration
public static void Clear()

CreateCacheKey(CultureInfo, String[])

Creates the cache key.

Declaration
public static string CreateCacheKey(CultureInfo culture, params string[] keys)
Parameters
Type Name Description
System.Globalization.CultureInfo culture

The culture.

System.String[] keys

The keys.

Returns
Type Description
System.String

CreateCacheKey(String[])

Creates the cache key with current UI culture.

Declaration
public static string CreateCacheKey(params string[] keys)
Parameters
Type Name Description
System.String[] keys

The keys.

Returns
Type Description
System.String

Get(String)

Gets the cached value for 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, IEnumerable<String>, TimeSpan)

Inserts the value into the cache with the specified key, with dependency to a set of master keys.

Declaration
public static void Insert(string key, object value, IEnumerable<string> masterKeys, TimeSpan timeout)
Parameters
Type Name Description
System.String key

The key.

System.Object value

The value to cache.

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

The master keys that we depend upon. These don't have to exist in the cache, they will be inserted if they don't exist.

System.TimeSpan timeout

The cache timeout.

Insert(String, Object, TimeSpan)

Inserts the value into the cache with the specified key, with dependency to a master key.

Declaration
public static void Insert(string key, object value, TimeSpan timeout)
Parameters
Type Name Description
System.String key

The key.

System.Object value

The value to cache.

System.TimeSpan timeout

The cache timeout.

Insert(String, Object, TimeSpan, CacheItemPriority)

Inserts the specified key.

Declaration
[Obsolete("CacheItemPriority and CacheDependency might not be supported on all systems, use an overload without CacheItemPriority or CacheDependency. Will remain at least until March 2016.")]
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
[Obsolete("CacheItemPriority and CacheDependency might not be supported on all systems, use an overload without CacheItemPriority or CacheDependency. Will remain at least until March 2016.")]
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 item into the cache.

Declaration
[Obsolete("CacheItemPriority and CacheDependency might not be supported on all systems, use an overload without CacheItemPriority or CacheDependency. Will remain at least until March 2016.")]
public static void Insert(string key, object value, CacheDependency dep, TimeSpan timeout, CacheItemPriority priority)
Parameters
Type Name Description
System.String key

The key.

System.Object value

The value to cache.

System.Web.Caching.CacheDependency dep

Any dependencies from the cached value, or null if there are none.

System.TimeSpan timeout

The amount of time to cache the item for.

System.Web.Caching.CacheItemPriority priority

The priority to cache the item with.

ReadThrough<T>(String, IEnumerable<String>, TimeSpan, Func<T>)

Read-through cache handling.

Declaration
public static T ReadThrough<T>(string key, IEnumerable<string> masterKeys, TimeSpan timeout, Func<T> load)
    where T : class
Parameters
Type Name Description
System.String key

The key.

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

The master keys that the cached item should depend on.

System.TimeSpan timeout

The cache timeout.

System.Func<T> load

The function to invoke for retrieving the value if it does not exist in the cache.

Returns
Type Description
T

The object associated with the key, if it exists or is read thru the readValue fuction. Otherwise returns null.

Type Parameters
Name Description
T

Type of the value to read.

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
[Obsolete("Removing by pattern is no longer supported, calling it will result in a Clear(). Will remain at least until March 2016.")]
public static void RemoveByPattern(string pattern)
Parameters
Type Name Description
System.String pattern

The pattern.