TransactionAttribute 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 TransactionAttribute 類別的新執行個體。
多載
TransactionAttribute() |
將元件要求的交易類型設定為 TransactionAttribute,初始化 Required 類別的新執行個體。 |
TransactionAttribute(TransactionOption) |
指定交易類型別,來初始化 TransactionAttribute 類別的新執行個體。 |
TransactionAttribute()
將元件要求的交易類型設定為 TransactionAttribute,初始化 Required 類別的新執行個體。
public:
TransactionAttribute();
public TransactionAttribute ();
Public Sub New ()
範例
下列程式代碼範例會建立新的 TransactionAttribute。
[Transaction]
public class TransactionAttribute_Ctor : ServicedComponent
{
}
<Transaction()> _
Public Class TransactionAttribute_Ctor
Inherits ServicedComponent
End Class
適用於
TransactionAttribute(TransactionOption)
指定交易類型別,來初始化 TransactionAttribute 類別的新執行個體。
public:
TransactionAttribute(System::EnterpriseServices::TransactionOption val);
public TransactionAttribute (System.EnterpriseServices.TransactionOption val);
new System.EnterpriseServices.TransactionAttribute : System.EnterpriseServices.TransactionOption -> System.EnterpriseServices.TransactionAttribute
Public Sub New (val As TransactionOption)
參數
指定的交易類型,TransactionOption 值。
範例
下列程式代碼範例會建立新的 TransactionAttribute。
[Transaction(TransactionOption.Supported)]
public class TransactionAttribute_Ctor_TransactionOption : ServicedComponent
{
}
[Transaction(TransactionOption.Supported,
Isolation=TransactionIsolationLevel.Serializable)]
public class TransactionAttribute_Ctor_TransactionOption_Isolation :
ServicedComponent
{
}
[Transaction(TransactionOption.Supported,
Isolation=TransactionIsolationLevel.Serializable,
Timeout=30)]
public class TransactionAttribute_Ctor_TransactionOption_Isolation_Timeout :
ServicedComponent
{
}
<Transaction(TransactionOption.Supported)> _
Public Class TransactionAttribute_Ctor_TransactionOption
Inherits ServicedComponent
End Class
<Transaction(TransactionOption.Supported, Isolation := TransactionIsolationLevel.Serializable)> _
Public Class TransactionAttribute_Ctor_TransactionOption_Isolation
Inherits ServicedComponent
End Class
<Transaction(TransactionOption.Supported, Isolation := TransactionIsolationLevel.Serializable, Timeout := 30)> _
Public Class TransactionAttribute_Ctor_TransactionOption_Isolation_Timeout
Inherits ServicedComponent
End Class