Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TransactionMessageProperty::Set Method (Transaction^, Message^)

 

Sets the transaction that will be used when executing the service method.

Namespace:   System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public:
static void Set(
	Transaction^ transaction,
	Message^ message
)

Parameters

transaction
Type: System.Transactions::Transaction^

The transaction that will be used when executing the service method.

message
Type: System.ServiceModel.Channels::Message^

The incoming message that results in calling the service method.

Exception Condition
FaultException

The property has already been set on message.

TransactionException

transaction needs to be unmarshaled, and that operation fails.

A custom incoming channel (which is part of a service’s channel stack) can call this method to add a TransactionMessageProperty, containing the transaction parameter, to the Properties collection of the message parameter. This prompts the infrastructure to create a TransactionScope instance using the transaction passed in, before calling the service method requested in the incoming message. The service method must have the TransactionScopeRequired property set to true.

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft