OperationContext.SetTransactionComplete 方法

定義

認可目前執行的異動。Commits the currently executing transaction.

public:
 void SetTransactionComplete();
public void SetTransactionComplete ();
member this.SetTransactionComplete : unit -> unit
Public Sub SetTransactionComplete ()

例外狀況

內容中沒有異動。There is no transaction in the context.

備註

這只對把 OperationBehaviorAttribute.TransactionAutoComplete 設為 false 的作業才有效。This is only useful in operations that set OperationBehaviorAttribute.TransactionAutoComplete to false. 一般而言,服務會對某些作業做這件事,但並非所有作業都做。Typically, services do this on some but not all operations. OperationBehaviorAttribute.TransactionAutoComplete 為 false 時,交易就自動完成。When OperationBehaviorAttribute.TransactionAutoComplete is false the transaction completes automatically. 若在設計階段無法判斷是否需要完成異動,請使用 SetTransactionCompleteUse SetTransactionComplete in cases where it is not possible to determine at design-time whether an operation needs to complete the transaction.

適用於