다음을 통해 공유


GetBasket Method (Guid, Guid)

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

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

Syntax

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

returnValue = instance.GetBasket(userId, _
    orderGroupId)
public Basket GetBasket(
    Guid userId,
    Guid orderGroupId
)
public:
Basket^ GetBasket(
    Guid userId, 
    Guid orderGroupId
)
public function GetBasket(
    userId : Guid, 
    orderGroupId : 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

userId or orderGroupId is empty.

Remarks

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

Permissions

See Also

Reference

OrderContext Class

OrderContext Members

GetBasket Overload

Microsoft.CommerceServer.Runtime.Orders Namespace