Share via


GetOrderTemplate Method (Guid, String)

Returns an existing instance of the OrderTemplate using the specified customer identifier and the order template name, or creates a new one if none already exist.

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

Syntax

'Declaration
Public Function GetOrderTemplate ( _
    userId As Guid, _
    orderTemplateName As String _
) As OrderTemplate
'Usage
Dim instance As OrderContext
Dim userId As Guid
Dim orderTemplateName As String
Dim returnValue As OrderTemplate

returnValue = instance.GetOrderTemplate(userId, _
    orderTemplateName)
public OrderTemplate GetOrderTemplate(
    Guid userId,
    string orderTemplateName
)
public:
OrderTemplate^ GetOrderTemplate(
    Guid userId, 
    String^ orderTemplateName
)
public function GetOrderTemplate(
    userId : Guid, 
    orderTemplateName : String
) : OrderTemplate

Parameters

  • userId
    Type: System..::.Guid
    The identifier of the customer owning the order template. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).

Return Value

Type: Microsoft.CommerceServer.Runtime.Orders..::.OrderTemplate
An instance of the OrderTemplate instance, or a new order template instance, if one is not found.

Exceptions

Exception Condition
ArgumentException

The specified customer identifier is nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

Use this method to retrieve a OrderTemplate meeting the specified criteria, the identifier of the customer and the order template name. If no OrderTemplate currently exists, one is created.

Permissions

See Also

Reference

OrderContext Class

OrderContext Members

GetOrderTemplate Overload

Microsoft.CommerceServer.Runtime.Orders Namespace