다음을 통해 공유


Save Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Saves the basket instance to the database.

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

Syntax

'Declaration
Public Overrides Sub Save
'Usage
Dim instance As Basket

instance.Save()
public override void Save()
public:
virtual void Save() override
public override function Save()

Exceptions

Exception Condition
SerializationException

A weakly-typed property entry not starting with "_" (underscore) in a class instance was not serializable. All weakly-typed property entries that will be marshaled to storage (i.e., having no underscore prefix to prevent them being marshaled) must be serializable.

ConfiguredLimitExceededException

If you were to save this instance to the database you would exceed the specified maximum number of instances for this user. The number of Basket objects within the database, can be set within the web.config file with the sPerUser parameter.

InvalidCatalogOperationException

The current instance has been disposed, either directly or by conversion to a PurchaseOrder instance.

Remarks

Use this method to persist the basket to the underlying stores.

Basket will update LastModified and update the database regardless of whether the basket has had any other modification to it. This ensures that the LastModified time reflects the last time any code explicitly called Save.

When a Basket is serialized and saved to the database, the LastModified field is automatically updated even if no recent changes have been made to the Basket. Created and LastModified are system properties that are written by the Commerce Server system. If you want to preserve Basket properties that reflect historical Created and LastModified values, you should create a set of custom properties that are not overridden by the system.

Permissions

See Also

Reference

Basket Class

Basket Members

Microsoft.CommerceServer.Runtime.Orders Namespace