Create Method (String, String)
Creates or gets a new instance of the OrderContext class with the specified connection strings.
Namespace: Microsoft.CommerceServer.Runtime.Orders
Assembly: Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)
Syntax
'Declaration
Public Shared Function Create ( _
transactionResourceConnectionString As String, _
transactionConfigResourceConnectionString As String _
) As OrderContext
'Usage
Dim transactionResourceConnectionString As String
Dim transactionConfigResourceConnectionString As String
Dim returnValue As OrderContext
returnValue = OrderContext.Create(transactionResourceConnectionString, _
transactionConfigResourceConnectionString)
public static OrderContext Create(
string transactionResourceConnectionString,
string transactionConfigResourceConnectionString
)
public:
static OrderContext^ Create(
String^ transactionResourceConnectionString,
String^ transactionConfigResourceConnectionString
)
public static function Create(
transactionResourceConnectionString : String,
transactionConfigResourceConnectionString : String
) : OrderContext
Parameters
- transactionResourceConnectionString
Type: System..::.String
Connection string for transaction database. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
- transactionConfigResourceConnectionString
Type: System..::.String
Connection string for transaction config database. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
Return Value
Type: Microsoft.CommerceServer.Runtime.Orders..::.OrderContext
An OrderContext class with the specified connection strings.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | transactionResourceConnectionString or transactionConfigResourceConnectionString 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 class with the specified connection string and debug context. If an instance already exists, method returns that instance.
To get the OrderContext instance from your code, this method should not be called. Instead, use the following.
OrderContext orderContext = CommerceContext.Current.OrderSystem;
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.