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
- siteName
Type: System..::.String
Name of the Commerce Server Site.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.