Επεξεργασία

Κοινή χρήση μέσω


TransactionAttribute Constructors

Definition

Initializes a new instance of the TransactionAttribute class.

Overloads

TransactionAttribute()

Initializes a new instance of the TransactionAttribute class, setting the component's requested transaction type to Required.

TransactionAttribute(TransactionOption)

Initializes a new instance of the TransactionAttribute class, specifying the transaction type.

TransactionAttribute()

Initializes a new instance of the TransactionAttribute class, setting the component's requested transaction type to Required.

public:
 TransactionAttribute();
public TransactionAttribute ();
Public Sub New ()

Examples

The following code example creates a new TransactionAttribute.

[Transaction]
public class TransactionAttribute_Ctor : ServicedComponent
{
}
<Transaction()>  _
Public Class TransactionAttribute_Ctor
    Inherits ServicedComponent
End Class

Applies to

TransactionAttribute(TransactionOption)

Initializes a new instance of the TransactionAttribute class, specifying the transaction type.

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)

Parameters

val
TransactionOption

The specified transaction type, a TransactionOption value.

Examples

The following code example creates a new 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

Applies to