Class OrderContextService
- Namespace
- Dynamicweb.Ecommerce.Orders
- Assembly
- Dynamicweb.Ecommerce.dll
Provides access to the order contexts configured in the solution.
public class OrderContextService : ICacheStorage<string, OrderContext>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
OrderContextService
- Implements
- Inherited Members
Properties
Info
Information about the object cache
public virtual CacheInformation Info { get; }
Property Value
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public virtual void ClearCache()
ClearCache(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
public virtual void ClearCache(IEnumerable<string> keys)
Parameters
keysIEnumerable<string>Keys to reset
ClearCache(string)
Resets the specified key to the default value for objects stored in the object cache
public virtual void ClearCache(string key)
Parameters
keystringKey to reset
Delete(OrderContext)
Deletes the specified order context if it has an id.
public virtual void Delete(OrderContext orderContext)
Parameters
orderContextOrderContextThe entity to delete.
Exceptions
- ArgumentNullException
Thrown when
orderContextisnull.
GetOrderContextById(string)
Gets an order context by its id.
public virtual OrderContext? GetOrderContextById(string id)
Parameters
idstringThe order context id. Matched case-insensitively.
Returns
- OrderContext
The matching OrderContext, or
nullif nothing was found.
GetOrderContexts()
Gets all order contexts.
public virtual IEnumerable<OrderContext> GetOrderContexts()
Returns
- IEnumerable<OrderContext>
An IEnumerable<T> sequence of all OrderContext entities.
Save(OrderContext)
Saves an order context to the database.
public virtual void Save(OrderContext orderContext)
Parameters
orderContextOrderContextThe entity to create or update.
Exceptions
- ArgumentNullException
Thrown when
orderContextisnull.
SetCacheType<TObjectCache>()
Changes the storage container
public virtual void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, OrderContext>
Type Parameters
TObjectCache