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 값입니다.

예제

다음 코드 예제에서는 값을 가져옵니다를 Transaction 특성의 Value 속성입니다.

[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

적용 대상