Table of Contents

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

CacheInformation

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

flow OrderFlow

The flow to check.

Returns

bool

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

keys IEnumerable<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

key int

Key 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

flow OrderFlow

The 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

flowType OrderType

Returns

OrderFlow

GetFlowById(int)

Gets a flow by id

public virtual OrderFlow? GetFlowById(int id)

Parameters

id int

The id of the flow

Returns

OrderFlow

An instance of OrderFlow, if found; otherwise, null.

GetFlowsByOrderType(OrderType)

Gets all flows by order type

public virtual IEnumerable<OrderFlow> GetFlowsByOrderType(OrderType orderType)

Parameters

orderType OrderType

Returns

IEnumerable<OrderFlow>

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

flow OrderFlow

The flow to save. Ignored when null.

SetCacheType<TObjectCache>()

Changes the storage container

public void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<int, OrderFlow>

Type Parameters

TObjectCache
To top