Share via


Create Method (String)

Creates or gets the instance of the OrderContext class for the specified site.

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

Syntax

'Declaration
Public Shared Function Create ( _
    siteName As String _
) As OrderContext
'Usage
Dim siteName As String
Dim returnValue As OrderContext

returnValue = OrderContext.Create(siteName)
public static OrderContext Create(
    string siteName
)
public:
static OrderContext^ Create(
    String^ siteName
)
public static function Create(
    siteName : String
) : OrderContext

Parameters

Return Value

Type: Microsoft.CommerceServer.Runtime.Orders..::.OrderContext
An OrderContext for the specified site.

Exceptions

Exception Condition
ArgumentNullException

siteName is nullNothingnullptra null reference (Nothing in Visual Basic).

ArgumentException

The connection string is not in the proper format for ADO.NET. Or attempt is made to call this method with different site name than with which the OrderContext instance was created.

Remarks

Creates and returns a new instance of the OrderContext with the specified site name. If a context already exists, the method returns that instance.

Permissions

See Also

Reference

OrderContext Class

OrderContext Members

Create Overload

Microsoft.CommerceServer.Runtime.Orders Namespace