TransactionAttribute.Value プロパティ

定義

トランザクションの TransactionOption 値を取得して、オプションでトランザクション サービスを無効にします。

public:
 property System::EnterpriseServices::TransactionOption Value { System::EnterpriseServices::TransactionOption get(); };
public System.EnterpriseServices.TransactionOption Value { get; }
member this.Value : System.EnterpriseServices.TransactionOption
Public ReadOnly Property Value As TransactionOption

プロパティ値

指定されたトランザクション タイプ (TransactionOption 値)。

次のコード例では、属性Valueの プロパティの値をTransaction取得します。

[Transaction(TransactionOption.RequiresNew)]
public class TransactionAttribute_Value : ServicedComponent
{
    public void ValueExample()
    {
        // Get the TransactionAttribute applied to the class.
        TransactionAttribute attribute =
            (TransactionAttribute)Attribute.GetCustomAttribute(
            this.GetType(),
            typeof(TransactionAttribute),
            false);

        // Display the value of the attribute's Value property.
        Console.WriteLine("TransactionAttribute.Value: {0}",
            attribute.Value);
    }
}
<Transaction(TransactionOption.RequiresNew)>  _
Public Class TransactionAttribute_Value
    Inherits ServicedComponent
    
    Public Sub ValueExample() 
        ' Get the TransactionAttribute applied to the class.
        Dim attribute As TransactionAttribute = CType(Attribute.GetCustomAttribute(Me.GetType(), GetType(TransactionAttribute), False), TransactionAttribute)
        
        ' Display the value of the attribute's Value property.
        MsgBox("TransactionAttribute.Value: " & attribute.Value)
    
    End Sub
End Class

適用対象