Class IOrderRepositoryExtensions

Provides convenience extension methods when working with IOrderRepository.

Inheritance
System.Object
IOrderRepositoryExtensions
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: EPiServer.Commerce.Order
Assembly: EPiServer.Business.Commerce.dll
Version: 10.8.0
Syntax
public static class IOrderRepositoryExtensions

Methods

LoadCart<TCart>(IOrderRepository, Guid, String)

Loads the cart for current market if exist or returns null.

Declaration
public static TCart LoadCart<TCart>(this IOrderRepository orderRepository, Guid customerId, string orderTypeName)
    where TCart : class, ICart
Parameters
Type Name Description
IOrderRepository orderRepository

The IOrderRepository that this method extends.

System.Guid customerId

The id of the customer to load the ICart for.

System.String orderTypeName

The type of order to load. The name is not unique for each order, instead it differentiates orders for a customer (e.g. Default or Wishlist).

Returns
Type Description
TCart

An ICart for the specified customer.

Type Parameters
Name Description
TCart

The type of ICart to load.

LoadCart<TCart>(IOrderRepository, Guid, String, ICurrentMarket)

Loads the cart for current market if exist or returns null.

Declaration
public static TCart LoadCart<TCart>(this IOrderRepository orderRepository, Guid customerId, string orderTypeName, ICurrentMarket currentMarket)
    where TCart : class, ICart
Parameters
Type Name Description
IOrderRepository orderRepository

The IOrderRepository that this method extends.

System.Guid customerId

The id of the customer to load the ICart for.

System.String orderTypeName

The type of order to load. The name is not unique for each order, instead it differentiates orders for a customer (e.g. Default or Wishlist).

ICurrentMarket currentMarket

The ICurrentMarket.

Returns
Type Description
TCart

An ICart for the specified customer.

Type Parameters
Name Description
TCart

The type of ICart to load.

LoadCart<TCart>(IOrderRepository, Guid, String, MarketId)

Loads the cart for a specific market if exist or returns null.

Declaration
public static TCart LoadCart<TCart>(this IOrderRepository orderRepository, Guid customerId, string orderTypeName, MarketId marketId)
    where TCart : class, ICart
Parameters
Type Name Description
IOrderRepository orderRepository

The IOrderRepository that this method extends.

System.Guid customerId

The id of the customer to load the ICart for.

System.String orderTypeName

The type of order to load. The name is not unique for each order, instead it differentiates orders for a customer (e.g. Default or Wishlist).

MarketId marketId

The market id.

Returns
Type Description
TCart

An ICart for the specified customer.

Type Parameters
Name Description
TCart

The type of ICart to load.

LoadOrCreateCart<TCart>(IOrderRepository, Guid, String)

Loads the specific type of order for the specified customer. If type of order does not exist one will be created and returned.

Declaration
public static TCart LoadOrCreateCart<TCart>(this IOrderRepository orderRepository, Guid customerId, string orderTypeName)
    where TCart : class, ICart
Parameters
Type Name Description
IOrderRepository orderRepository

The IOrderRepository that this method extends.

System.Guid customerId

The id of the customer to load the order for.

System.String orderTypeName

The type of order to load (or create). The name is not unique for each order, instead it differentiates orders for a customer (e.g. Default or Wishlist).

Returns
Type Description
TCart

An order for the specified customer in current market.

Type Parameters
Name Description
TCart

The type of ICart to load or create.

LoadOrCreateCart<TCart>(IOrderRepository, Guid, String, ICurrentMarket)

Loads the specific type of order for the specified customer. If type of order does not exist one will be created and returned.

Declaration
public static TCart LoadOrCreateCart<TCart>(this IOrderRepository orderRepository, Guid customerId, string orderTypeName, ICurrentMarket currentMarket)
    where TCart : class, ICart
Parameters
Type Name Description
IOrderRepository orderRepository

The IOrderRepository that this method extends.

System.Guid customerId

The id of the customer to load the order for.

System.String orderTypeName

The type of order to load (or create). The name is not unique for each order, instead it differentiates orders for a customer (e.g. Default or Wishlist).

ICurrentMarket currentMarket

The current market.

Returns
Type Description
TCart

An order for the specified customer in current market.

Type Parameters
Name Description
TCart

The type of ICart to load or create.