TransactionAttribute.Value 属性  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取事务的 TransactionOption 值,并且可以选择禁用事务服务。
public:
 property System::EnterpriseServices::TransactionOption Value { System::EnterpriseServices::TransactionOption get(); };public System.EnterpriseServices.TransactionOption Value { get; }member this.Value : System.EnterpriseServices.TransactionOptionPublic 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