Class DefaultOrderRepository
Default repository for ICart, IPurchaseOrder, and IPaymentPlan./>
Inheritance
Inherited Members
Namespace: EPiServer.Commerce.Order.Internal
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0Syntax
public class DefaultOrderRepository : IOrderRepository, IPurchaseOrderRepository
Constructors
DefaultOrderRepository(ICartProvider, IPurchaseOrderProvider, IPaymentPlanProvider, ISynchronizedObjectInstanceCache, DefaultOrderEvents, ServiceCollectionAccessor<IOrderRepositoryCallback>)
Creates an instance of the DefaultOrderRepository.
Declaration
public DefaultOrderRepository(ICartProvider cartProvider, IPurchaseOrderProvider purchaseOrderProvider, IPaymentPlanProvider paymentPlanProvider, ISynchronizedObjectInstanceCache objectInstanceCache, DefaultOrderEvents orderEvents, ServiceCollectionAccessor<IOrderRepositoryCallback> accessor)
Parameters
Type | Name | Description |
---|---|---|
ICartProvider | cartProvider | The cart provider. |
IPurchaseOrderProvider | purchaseOrderProvider | The purchase order provider. |
IPaymentPlanProvider | paymentPlanProvider | The payment plan provider. |
EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache | objectInstanceCache | The object instance cache |
DefaultOrderEvents | orderEvents | The order events. |
EPiServer.ServiceLocation.ServiceCollectionAccessor<IOrderRepositoryCallback> | accessor | The accessor for IOrderRepositoryCallback |
Methods
Create<TOrderGroup>(Guid, String)
Creates an order.
Declaration
public virtual TOrderGroup Create<TOrderGroup>(Guid customerId, string name)
where TOrderGroup : class, IOrderGroup
Parameters
Type | Name | Description |
---|---|---|
System.Guid | customerId | The customer guid. |
System.String | name | The name of the order. |
Returns
Type | Description |
---|---|
TOrderGroup | The created order. |
Type Parameters
Name | Description |
---|---|
TOrderGroup | The type of IOrderGroup. |
Delete(OrderReference)
Deletes an order.
Declaration
public virtual void Delete(OrderReference orderLink)
Parameters
Type | Name | Description |
---|---|---|
OrderReference | orderLink | The order link. |
Load(OrderReference)
Loads an order.
Declaration
public virtual IOrderGroup Load(OrderReference orderLink)
Parameters
Type | Name | Description |
---|---|---|
OrderReference | orderLink | The order link. |
Returns
Type | Description |
---|---|
IOrderGroup | The order. |
Remarks
Instances of Cart, PaymentPlan and PurchaseOrder returned by this method are deep clones of their cached instances. I.e. modifying objects of those types returned by this method will not modify the cache.
Load(Guid, String)
Loads all orders for a customer.
Declaration
[Obsolete("This method is no longer used. Will remain at least until January 2020.")]
public virtual IEnumerable<IOrderGroup> Load(Guid customerId, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | customerId | The customer guid. |
System.String | name | The name of the order. The name is not unique for each order, instead it's suppose to differentiate orders of the same type. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IOrderGroup> | The orders. |
Remarks
Instances of Cart, PaymentPlan and PurchaseOrder returned by this method are deep clones of their cached instances. I.e. modifying objects of those types returned by this method will not modify the cache.
Load(String)
Loads a specific purchase order by the tracking number.
Declaration
public IPurchaseOrder Load(string trackingNumber)
Parameters
Type | Name | Description |
---|---|---|
System.String | trackingNumber | The tracking number. |
Returns
Type | Description |
---|---|
IPurchaseOrder | The matching IPurchaseOrder. |
Load<TOrderGroup>(Guid, String)
Loads all orders of a specific type for a customer.
Declaration
public virtual IEnumerable<TOrderGroup> Load<TOrderGroup>(Guid customerId, string name)
where TOrderGroup : class, IOrderGroup
Parameters
Type | Name | Description |
---|---|---|
System.Guid | customerId | The customer id. |
System.String | name | The name of the order. The name is not unique for each order, instead it's suppose to differentiate orders of the same type. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TOrderGroup> | The orders. |
Type Parameters
Name | Description |
---|---|
TOrderGroup | The type of IOrderGroup. |
Remarks
Instances of Cart, PaymentPlan and PurchaseOrder returned by this method are deep clones of their cached instances. I.e. modifying objects of those types returned by this method will not modify the cache.
Load<TOrderGroup>(Int32)
Loads an order.
Declaration
public virtual TOrderGroup Load<TOrderGroup>(int orderGroupId)
where TOrderGroup : class, IOrderGroup
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | orderGroupId | The order group id. |
Returns
Type | Description |
---|---|
TOrderGroup | The order. |
Type Parameters
Name | Description |
---|---|
TOrderGroup | The type of IOrderGroup. |
Remarks
Instances of Cart, PaymentPlan and PurchaseOrder returned by this method are deep clones of their cached instances. I.e. modifying objects of those types returned by this method will not modify the cache.
Save(IOrderGroup)
Saves the order.
Declaration
public virtual OrderReference Save(IOrderGroup order)
Parameters
Type | Name | Description |
---|---|---|
IOrderGroup | order | The order. |
Returns
Type | Description |
---|---|
OrderReference | The OrderReference. |
SaveAsPaymentPlan(IOrderGroup)
Saves as payment plan.
Declaration
public virtual OrderReference SaveAsPaymentPlan(IOrderGroup cart)
Parameters
Type | Name | Description |
---|---|---|
IOrderGroup | cart | The order group. |
Returns
Type | Description |
---|---|
OrderReference | The OrderReference. |
SaveAsPurchaseOrder(IOrderGroup)
Saves as purchase order.
Declaration
public virtual OrderReference SaveAsPurchaseOrder(IOrderGroup cart)
Parameters
Type | Name | Description |
---|---|---|
IOrderGroup | cart | The order group. |
Returns
Type | Description |
---|---|
OrderReference | The OrderReference. |