Class SerializableCartDB
This type/member supports the EPiServer infrastructure and is not intended to be used directly from your code.
Represents database access class to manipulate SerializableCart.
Inheritance
Implements
Namespace: EPiServer.Commerce.Order.Internal.DataAccess
Assembly: EPiServer.Business.Commerce.dll
Version: 14.26.0Syntax
public class SerializableCartDB : Object, ICartSearchService
Constructors
SerializableCartDB(IConnectionStringHandler)
Initializes a new instance of the SerializableCartDB class.
Declaration
public SerializableCartDB(IConnectionStringHandler connectionHandler)
Parameters
Type | Name | Description |
---|---|---|
IConnectionStringHandler | connectionHandler | The connection string handler. |
Methods
Delete(ICart)
Deletes a SerializableCart.
Declaration
public void Delete(ICart cart)
Parameters
Type | Name | Description |
---|---|---|
ICart | cart | The cart to delete. |
FindCarts(CartFilter)
Finds SerializableCarts by a given CartFilter.
Declaration
public virtual IEnumerable<SerializableCart> FindCarts(CartFilter cartFilter)
Parameters
Type | Name | Description |
---|---|---|
CartFilter | cartFilter | The filter options when finding cart. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SerializableCart> | The collection of SerializableCart. |
FindCarts(CartFilter, out Int32)
Finds SerializableCarts by a given CartFilter.
Declaration
public virtual IEnumerable<SerializableCart> FindCarts(CartFilter cartFilter, out int totalRecords)
Parameters
Type | Name | Description |
---|---|---|
CartFilter | cartFilter | The filter options when finding cart. |
System.Int32 | totalRecords | The total records. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SerializableCart> | The collection of SerializableCart. |
FindCarts(OrderSearchFilter, out Int32)
Finds ICart by a set of parameters in filter
.
Declaration
public IEnumerable<ICart> FindCarts(OrderSearchFilter filter, out int totalRecords)
Parameters
Type | Name | Description |
---|---|---|
OrderSearchFilter | filter | The filter options when finding cart. |
System.Int32 | totalRecords | The total records returned. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ICart> | A collection of ICart matching all criteria in the |
FindCarts(OrderSearchField, String, IEnumerable<String>, Int32, Int32, Boolean, out Int32)
Finds ICart by search field and search value.
Declaration
public IEnumerable<ICart> FindCarts(OrderSearchField searchField, string searchValue, IEnumerable<string> excludedCartNames, int startIndex, int recordsToRetrieve, bool returnTotalCount, out int totalRecords)
Parameters
Type | Name | Description |
---|---|---|
OrderSearchField | searchField | The search field use to search. For example: Email, CustomerName. |
System.String | searchValue | The search value. |
System.Collections.Generic.IEnumerable<System.String> | excludedCartNames | The cart names that will be excluded when finding carts. |
System.Int32 | startIndex | The starting index of record to retrieve. |
System.Int32 | recordsToRetrieve | The number of records to retrieve. |
System.Boolean | returnTotalCount | The flag to indicate if the search should return the total count of matched carts. |
System.Int32 | totalRecords | The total records returned. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ICart> | A collection of ICart. |
FindCartsAsync(String, OrderSearchFilter, IEnumerable<String>, CancellationToken)
Finds ICart by a set of parameters in filter
and CustomerEmail, CustomerName or CartId equal to or similar to searchValue
.
Declaration
public Task<OrderSearchResults<ICart>> FindCartsAsync(string searchValue, OrderSearchFilter filter, IEnumerable<string> excludedCartNames, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | searchValue | The search value use to search. For example: CustomerEmail, CustomerName or CartId. |
OrderSearchFilter | filter | The filter options when finding cart. |
System.Collections.Generic.IEnumerable<System.String> | excludedCartNames | The cart names that will be excluded when finding carts. |
System.Threading.CancellationToken | cancellationToken | The cancellation instruction. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<OrderSearchResults<ICart>> | A task of OrderSearchResults<T>. Contains a collection of ICart matching all criteria in the |
InsertBatchCarts(IEnumerable<SerializableCart>)
Insert a list of SerializableCart to the database. Carts will be stored in SerializableCart table.
Declaration
public void InsertBatchCarts(IEnumerable<SerializableCart> carts)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<SerializableCart> | carts | The list of SerializableCart needs to be inserted. |
Remarks
Use to insert serializable carts.
Load(CartFilter)
Loads SerializableCarts by a given CartFilter.
Declaration
public IEnumerable<SerializableCart> Load(CartFilter cartFilter)
Parameters
Type | Name | Description |
---|---|---|
CartFilter | cartFilter | The filter options when loading serializable cart. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SerializableCart> | The collection of SerializableCart. |
Save(SerializableCart)
Saves a SerializableCart to the database. The cart will be stored in SerializableCart table.
Declaration
public int Save(SerializableCart cart)
Parameters
Type | Name | Description |
---|---|---|
SerializableCart | cart | The SerializableCart needs to be saved. |
Returns
Type | Description |
---|---|
System.Int32 | The cart identifier. |
SaveBatchCarts(IEnumerable<SerializableCart>)
Saves a list of SerializableCart to the database. Carts will be stored in SerializableCart table.
Declaration
public void SaveBatchCarts(IEnumerable<SerializableCart> carts)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<SerializableCart> | carts | The list of SerializableCart needs to be saved. |
Remarks
Used to migrate existing serializable cart.