Partilhar via


GetBasket Method (Guid)

Returns an existing Basket using the specified customer identifier, or creates a new one if none already exist.

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

Syntax

'Declaration
Public Function GetBasket ( _
    userId As Guid _
) As Basket
'Usage
Dim instance As OrderContext
Dim userId As Guid
Dim returnValue As Basket

returnValue = instance.GetBasket(userId)
public Basket GetBasket(
    Guid userId
)
public:
Basket^ GetBasket(
    Guid userId
)
public function GetBasket(
    userId : Guid
) : Basket

Parameters

  • userId
    Type: System..::.Guid
    The identifier of the customer owning the basket.

Return Value

Type: Microsoft.CommerceServer.Runtime.Orders..::.Basket
The existing populated Basket instance, or a new empty basket instance, if one is not found.

Exceptions

Exception Condition
ConfiguredLimitExceededException

Creating a new basket would exceed the maximum allowable number of baskets per customer specified in the Web.config file.

ArgumentException

The specified customer identifier is empty.

Remarks

Use this method to retrieve a Basket meeting the specified criteria, the identifier of the customer. If no Basket currently exists, one is created.

Permissions

See Also

Reference

OrderContext Class

OrderContext Members

GetBasket Overload

Microsoft.CommerceServer.Runtime.Orders Namespace