Class OrderFlowService
- Namespace
- Dynamicweb.Ecommerce.Orders
- Assembly
- Dynamicweb.Ecommerce.dll
Manages the order flows an order can run through: reading them, keeping exactly one flow per order type marked as the default, and deleting the ones that are not in use.
public class OrderFlowService : ICacheStorage<int, OrderFlow>, ICacheStorage<int>, ICacheStorage
- Inheritance
-
OrderFlowService
- Implements
- Inherited Members
Properties
Info
Information about the object cache
public CacheInformation Info { get; }
Property Value
Methods
CanDelete(OrderFlow)
Gets a value indicating whether a flow can be deleted. A default flow cannot, and neither can one whose states are in use.
public virtual bool CanDelete(OrderFlow flow)
Parameters
flowOrderFlowThe flow to check.
Returns
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public void ClearCache()
ClearCache(IEnumerable<int>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<int> keys)
Parameters
keysIEnumerable<int>Keys to reset
ClearCache(int)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(int key)
Parameters
keyintKey to reset
Delete(OrderFlow)
Deletes a given flow, unless it is the default flow of its order type or one of its states is in use.
public virtual void Delete(OrderFlow flow)
Parameters
flowOrderFlowThe flow to delete
GetAllFlows()
Gets all flows
public virtual IEnumerable<OrderFlow> GetAllFlows()
Returns
- IEnumerable<OrderFlow>
All existing flows, regardless of order type.
GetDefaultFlowByOrderType(OrderType)
Gets default flow by order type
public virtual OrderFlow? GetDefaultFlowByOrderType(OrderType flowType)
Parameters
flowTypeOrderType
Returns
GetFlowById(int)
Gets a flow by id
public virtual OrderFlow? GetFlowById(int id)
Parameters
idintThe id of the flow
Returns
GetFlowsByOrderType(OrderType)
Gets all flows by order type
public virtual IEnumerable<OrderFlow> GetFlowsByOrderType(OrderType orderType)
Parameters
orderTypeOrderType
Returns
Save(OrderFlow)
Saves a given flow. The order type it belongs to is left with exactly one default flow.
public virtual void Save(OrderFlow flow)
Parameters
flowOrderFlowThe flow to save. Ignored when
null.
SetCacheType<TObjectCache>()
Changes the storage container
public void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<int, OrderFlow>
Type Parameters
TObjectCache