TransactionMessageProperty.Set(Transaction, Message) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the transaction that will be used when executing the service method.
public:
static void Set(System::Transactions::Transaction ^ transaction, System::ServiceModel::Channels::Message ^ message);
public static void Set (System.Transactions.Transaction transaction, System.ServiceModel.Channels.Message message);
static member Set : System.Transactions.Transaction * System.ServiceModel.Channels.Message -> unit
Public Shared Sub Set (transaction As Transaction, message As Message)
Parameters
- transaction
- Transaction
The transaction that will be used when executing the service method.
- message
- Message
The incoming message that results in calling the service method.
Exceptions
The property has already been set on message
.
transaction
needs to be unmarshaled, and that operation fails.
Remarks
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
.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應