Share via


Basket Constructor (SerializationInfo, StreamingContext)

Initializes a new instance of the Basket class using the specified serialization and streaming context information.

Namespace:  Microsoft.CommerceServer.Runtime.Orders
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Protected Sub New ( _
    info As SerializationInfo, _
    context As StreamingContext _
)
'Usage
Dim info As SerializationInfo
Dim context As StreamingContext

Dim instance As New Basket(info, context)
protected Basket(
    SerializationInfo info,
    StreamingContext context
)
protected:
Basket(
    SerializationInfo^ info, 
    StreamingContext context
)
protected function Basket(
    info : SerializationInfo, 
    context : StreamingContext
)

Parameters

Exceptions

Exception Condition
InvalidCastException

The data you are using to deserialize potentially does not have the same fields or field types as the existing runtime object. This could indicate a version mismatch between the runtime objects and the stored data.

SerializationException

There was a version mismatch between the data being deserialized and the current runtime object.

Remarks

This constructor is marked protected so it can be called from the deserialization constructors of derived classes. This constructor must be called from a derived class's deserialization constructor to ensure that deserialization succeeds.

Orders are divided into three states within the order capture system. These states and respective classes are: basket (Basket). order template (OrderTemplate), and purchase order (PurchaseOrder). An order's lifecycle generally proceeds from a basket to a purchase order. However, it is also possible to transition from an order template to a basket and then to a purchase order. The methods and properties of Basket are provided to capture the information required for a purchase order. Conceptually, the basket represents the shopping cart stage of an e-commerce site.

Baskets are uniquely identified by basket ID and basket name. The BasketID property of a basket is the same as the ID of the customer owning the basket. The Name property indicates the name of the basket. For backward compatibility, the name for baskets in Commerce Server 2007 defaults to String.Empty.

Baskets are created and returned with the overloaded GetBasket methods in OrderContext class.

It is possible to add contents of existing purchase orders or order templates to baskets via the Add method. Baskets can be converted to purchase orders (baskets are the only entities in the order capture system that can be converted to purchase orders.) When a basket is successfully converted to a purchase order, the basket instance is purged from the order capture system.

Permissions

See Also

Reference

Basket Class

Basket Members

Basket Overload

Microsoft.CommerceServer.Runtime.Orders Namespace