共用方式為


TransactionAttribute 建構函式

定義

初始化 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)

參數

val
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

適用於