TransactionScope TransactionScope TransactionScope TransactionScope Constructors

Definizione

Overload

TransactionScope() TransactionScope() TransactionScope()

Inizializza una nuova istanza della classe TransactionScope.Initializes a new instance of the TransactionScope class.

TransactionScope(Transaction) TransactionScope(Transaction) TransactionScope(Transaction) TransactionScope(Transaction)

Inizializza una nuova istanza della classe TransactionScope e imposta la transazione specificata come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.Initializes a new instance of the TransactionScope class and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

TransactionScope(Transaction, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TransactionScopeAsyncFlowOption)

[Supportato in .NET Framework 4.5.1 e versioni successive][Supported in the .NET Framework 4.5.1 and later versions] Inizializza una nuova istanza della classe TransactionScope e imposta la transazione specificata come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.Initializes a new instance of the TransactionScope class and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

TransactionScope(TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeAsyncFlowOption)

Inizializza una nuova istanza della classe TransactionScope con l'opzione del flusso asincrono specificato.Initializes a new instance of the TransactionScope class with the specified asynchronous flow option.

TransactionScope(TransactionScopeOption) TransactionScope(TransactionScopeOption) TransactionScope(TransactionScopeOption) TransactionScope(TransactionScopeOption)

Inizializza una nuova istanza della classe TransactionScope con i requisiti specificati.Initializes a new instance of the TransactionScope class with the specified requirements.

TransactionScope(Transaction, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TimeSpan, TransactionScopeAsyncFlowOption)

[Supportato in .NET Framework 4.5.1 e versioni successive][Supported in the .NET Framework 4.5.1 and later versions] Inizializza una nuova istanza della classe TransactionScope con il valore di timeout specificato e imposta la transazione specificata come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.Initializes a new instance of the TransactionScope class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

TransactionScope(TransactionScopeOption, TransactionOptions) TransactionScope(TransactionScopeOption, TransactionOptions) TransactionScope(TransactionScopeOption, TransactionOptions) TransactionScope(TransactionScopeOption, TransactionOptions)

Inizializza una nuova istanza della classe TransactionScope con i requisiti specificati.Initializes a new instance of the TransactionScope class with the specified requirements.

TransactionScope(TransactionScopeOption, TransactionOptions, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TransactionOptions, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TransactionOptions, TransactionScopeAsyncFlowOption)

[Supportato in .NET Framework 4.5.1 e versioni successive][Supported in the .NET Framework 4.5.1 and later versions] Inizializza una nuova istanza della classe TransactionScope con i requisiti e le opzioni del flusso asincrono specificati.Initializes a new instance of the TransactionScope class with the specified requirements and asynchronous flow option.

TransactionScope(Transaction, TimeSpan) TransactionScope(Transaction, TimeSpan) TransactionScope(Transaction, TimeSpan) TransactionScope(Transaction, TimeSpan)

Inizializza una nuova istanza della classe TransactionScope con il valore di timeout specificato e imposta la transazione specificata come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.Initializes a new instance of the TransactionScope class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

TransactionScope(TransactionScopeOption, TimeSpan) TransactionScope(TransactionScopeOption, TimeSpan) TransactionScope(TransactionScopeOption, TimeSpan) TransactionScope(TransactionScopeOption, TimeSpan)

Inizializza una nuova istanza della classe TransactionScope con il valore di timeout e i requisiti specificati.Initializes a new instance of the TransactionScope class with the specified timeout value and requirements.

TransactionScope(TransactionScopeOption, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TransactionScopeAsyncFlowOption)

Inizializza una nuova istanza della classe TransactionScope con i requisiti e le opzioni del flusso asincrono specificati.Initializes a new instance of the TransactionScope class with the specified requirements and asynchronous flow option.

TransactionScope(TransactionScopeOption, TransactionOptions, EnterpriseServicesInteropOption) TransactionScope(TransactionScopeOption, TransactionOptions, EnterpriseServicesInteropOption) TransactionScope(TransactionScopeOption, TransactionOptions, EnterpriseServicesInteropOption) TransactionScope(TransactionScopeOption, TransactionOptions, EnterpriseServicesInteropOption)

Inizializza una nuova istanza della classe TransactionScope con l'ambito e i requisiti di interoperabilità COM+ specificati e le opzioni di transazione.Initializes a new instance of the TransactionScope class with the specified scope and COM+ interoperability requirements, and transaction options.

TransactionScope(Transaction, TimeSpan, EnterpriseServicesInteropOption) TransactionScope(Transaction, TimeSpan, EnterpriseServicesInteropOption) TransactionScope(Transaction, TimeSpan, EnterpriseServicesInteropOption) TransactionScope(Transaction, TimeSpan, EnterpriseServicesInteropOption)

Inizializza una nuova istanza della classe TransactionScope con il valore di timeout e i requisiti di interoperabilità COM+ specificati e imposta la transazione specificata come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.Initializes a new instance of the TransactionScope class with the specified timeout value and COM+ interoperability requirements, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

TransactionScope(TransactionScopeOption, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TimeSpan, TransactionScopeAsyncFlowOption)

Inizializza una nuova istanza della classe TransactionScope con il valore di timeout, i requisiti e le opzioni del flusso asincrono specificati.Initializes a new instance of the TransactionScope class with the specified timeout value, requirements, and asynchronous flow option.

TransactionScope() TransactionScope() TransactionScope()

Inizializza una nuova istanza della classe TransactionScope.Initializes a new instance of the TransactionScope class.

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

Commenti

Questo costruttore crea un nuovo ambito della transazione con l'opzione dell'ambito della Requiredtransazione uguale a.This constructor creates a new transaction scope with the transaction scope option equal to Required. Ciò significa che una transazione è richiesta dal nuovo ambito e che la transazione di ambiente viene utilizzata se ne esiste già una.This means that a transaction is required by the new scope and the ambient transaction is used if one already exists. In caso contrario, prima di accedere all'ambito viene creata una nuova transazione.Otherwise, it creates a new transaction before entering the scope.

Vedi anche

TransactionScope(Transaction) TransactionScope(Transaction) TransactionScope(Transaction) TransactionScope(Transaction)

Inizializza una nuova istanza della classe TransactionScope e imposta la transazione specificata come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.Initializes a new instance of the TransactionScope class and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

public:
 TransactionScope(System::Transactions::Transaction ^ transaction);
public TransactionScope (System.Transactions.Transaction transaction);
new System.Transactions.TransactionScope : System.Transactions.Transaction -> System.Transactions.TransactionScope
Public Sub New (transactionToUse As Transaction)

Parametri

transactionToUse
Transaction Transaction Transaction Transaction

Transazione da impostare come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.

Vedi anche

TransactionScope(Transaction, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TransactionScopeAsyncFlowOption)

[Supportato in .NET Framework 4.5.1 e versioni successive][Supported in the .NET Framework 4.5.1 and later versions] Inizializza una nuova istanza della classe TransactionScope e imposta la transazione specificata come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.Initializes a new instance of the TransactionScope class and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

public:
 TransactionScope(System::Transactions::Transaction ^ transactionToUse, System::Transactions::TransactionScopeAsyncFlowOption asyncFlowOption);
public TransactionScope (System.Transactions.Transaction transactionToUse, System.Transactions.TransactionScopeAsyncFlowOption asyncFlowOption);
new System.Transactions.TransactionScope : System.Transactions.Transaction * System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope
Public Sub New (transactionToUse As Transaction, asyncFlowOption As TransactionScopeAsyncFlowOption)

Parametri

transactionToUse
Transaction Transaction Transaction Transaction

Transazione da impostare come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.

asyncFlowOption
TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption

Un'istanza dell'enumerazione TransactionScopeAsyncFlowOption che descrive se la transazione di ambiente associata all'ambito della transazione passerà attraverso le continuazioni di thread quando si utilizzano i modelli di programmazione asincrona di .NET Task o async/await.An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

TransactionScope(TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeAsyncFlowOption)

Inizializza una nuova istanza della classe TransactionScope con l'opzione del flusso asincrono specificato.Initializes a new instance of the TransactionScope class with the specified asynchronous flow option.

public:
 TransactionScope(System::Transactions::TransactionScopeAsyncFlowOption asyncFlow);
public TransactionScope (System.Transactions.TransactionScopeAsyncFlowOption asyncFlow);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope
Public Sub New (asyncFlow As TransactionScopeAsyncFlowOption)

Parametri

asyncFlowOption
TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption

Un'istanza dell'enumerazione TransactionScopeAsyncFlowOption che descrive se la transazione di ambiente associata all'ambito della transazione passerà attraverso le continuazioni di thread quando si utilizzano i modelli di programmazione asincrona di .NET Task o async/await.An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

TransactionScope(TransactionScopeOption) TransactionScope(TransactionScopeOption) TransactionScope(TransactionScopeOption) TransactionScope(TransactionScopeOption)

Inizializza una nuova istanza della classe TransactionScope con i requisiti specificati.Initializes a new instance of the TransactionScope class with the specified requirements.

public:
 TransactionScope(System::Transactions::TransactionScopeOption option);
public TransactionScope (System.Transactions.TransactionScopeOption option);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption -> System.Transactions.TransactionScope
Public Sub New (option As TransactionScopeOption)

Parametri

scopeOption
TransactionScopeOption TransactionScopeOption TransactionScopeOption TransactionScopeOption

Istanza dell'enumerazione TransactionScopeOption che descrive i requisiti della transazione associati al relativo ambito.An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

Vedi anche

TransactionScope(Transaction, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(Transaction, TimeSpan, TransactionScopeAsyncFlowOption)

[Supportato in .NET Framework 4.5.1 e versioni successive][Supported in the .NET Framework 4.5.1 and later versions] Inizializza una nuova istanza della classe TransactionScope con il valore di timeout specificato e imposta la transazione specificata come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.Initializes a new instance of the TransactionScope class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

public:
 TransactionScope(System::Transactions::Transaction ^ transactionToUse, TimeSpan scopeTimeout, System::Transactions::TransactionScopeAsyncFlowOption asyncFlowOption);
public TransactionScope (System.Transactions.Transaction transactionToUse, TimeSpan scopeTimeout, System.Transactions.TransactionScopeAsyncFlowOption asyncFlowOption);
new System.Transactions.TransactionScope : System.Transactions.Transaction * TimeSpan * System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope
Public Sub New (transactionToUse As Transaction, scopeTimeout As TimeSpan, asyncFlowOption As TransactionScopeAsyncFlowOption)

Parametri

transactionToUse
Transaction Transaction Transaction Transaction

Transazione da impostare come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.

scopeTimeout
TimeSpan TimeSpan TimeSpan TimeSpan

TimeSpan dopo cui si verifica il timeout dell'ambito della transazione e l'interruzione della transazione.The TimeSpan after which the transaction scope times out and aborts the transaction.

asyncFlowOption
TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption

Un'istanza dell'enumerazione TransactionScopeAsyncFlowOption che descrive se la transazione di ambiente associata all'ambito della transazione passerà attraverso le continuazioni di thread quando si utilizzano i modelli di programmazione asincrona di .NET Task o async/await.An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

TransactionScope(TransactionScopeOption, TransactionOptions) TransactionScope(TransactionScopeOption, TransactionOptions) TransactionScope(TransactionScopeOption, TransactionOptions) TransactionScope(TransactionScopeOption, TransactionOptions)

Inizializza una nuova istanza della classe TransactionScope con i requisiti specificati.Initializes a new instance of the TransactionScope class with the specified requirements.

public:
 TransactionScope(System::Transactions::TransactionScopeOption scopeOption, System::Transactions::TransactionOptions options);
public TransactionScope (System.Transactions.TransactionScopeOption scopeOption, System.Transactions.TransactionOptions options);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * System.Transactions.TransactionOptions -> System.Transactions.TransactionScope
Public Sub New (scopeOption As TransactionScopeOption, options As TransactionOptions)

Parametri

scopeOption
TransactionScopeOption TransactionScopeOption TransactionScopeOption TransactionScopeOption

Istanza dell'enumerazione TransactionScopeOption che descrive i requisiti della transazione associati al relativo ambito.An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

transactionOptions
TransactionOptions TransactionOptions TransactionOptions TransactionOptions

Struttura TransactionOptions in cui sono descritte le opzioni di transazione da utilizzare se si crea una nuova transazione.A TransactionOptions structure that describes the transaction options to use if a new transaction is created. Se si utilizza una transazione esistente, il valore di timeout in questo parametro si applica all'ambito della transazione.If an existing transaction is used, the timeout value in this parameter applies to the transaction scope. Se il tempo scade prima dell'eliminazione dell'ambito, la transazione viene interrotta.If that time expires before the scope is disposed, the transaction is aborted.

Commenti

Quando si utilizza il transactionOptions parametro per specificare un IsolationLeveloggetto e l'ambito crea una transazione in un secondo momento, la nuova transazione viene associata al livello di isolamento specificato.When you use the transactionOptions parameter to specify an IsolationLevel, and the scope creates a transaction later, the new transaction is associated with the specified isolation level. Se un livello di isolamento viene passato insieme a una transazione, è necessario che la transazione disponga di un livello di isolamento identico o che venga generata un'eccezione.If an isolation level is passed in together with a transaction, the transaction must have an identical isolation level, or an exception is thrown.

Vedi anche

TransactionScope(TransactionScopeOption, TransactionOptions, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TransactionOptions, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TransactionOptions, TransactionScopeAsyncFlowOption)

[Supportato in .NET Framework 4.5.1 e versioni successive][Supported in the .NET Framework 4.5.1 and later versions] Inizializza una nuova istanza della classe TransactionScope con i requisiti e le opzioni del flusso asincrono specificati.Initializes a new instance of the TransactionScope class with the specified requirements and asynchronous flow option.

public:
 TransactionScope(System::Transactions::TransactionScopeOption scopeOption, System::Transactions::TransactionOptions transactionOptions, System::Transactions::TransactionScopeAsyncFlowOption asyncFlowOption);
public TransactionScope (System.Transactions.TransactionScopeOption scopeOption, System.Transactions.TransactionOptions transactionOptions, System.Transactions.TransactionScopeAsyncFlowOption asyncFlowOption);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * System.Transactions.TransactionOptions * System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope

Parametri

scopeOption
TransactionScopeOption TransactionScopeOption TransactionScopeOption TransactionScopeOption

Istanza dell'enumerazione TransactionScopeOption che descrive i requisiti della transazione associati al relativo ambito.An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

transactionOptions
TransactionOptions TransactionOptions TransactionOptions TransactionOptions

Struttura TransactionOptions in cui sono descritte le opzioni di transazione da utilizzare se si crea una nuova transazione.A TransactionOptions structure that describes the transaction options to use if a new transaction is created. Se si utilizza una transazione esistente, il valore di timeout in questo parametro si applica all'ambito della transazione.If an existing transaction is used, the timeout value in this parameter applies to the transaction scope. Se il tempo scade prima dell'eliminazione dell'ambito, la transazione viene interrotta.If that time expires before the scope is disposed, the transaction is aborted.

asyncFlowOption
TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption

Un'istanza dell'enumerazione TransactionScopeAsyncFlowOption che descrive se la transazione di ambiente associata all'ambito della transazione passerà attraverso le continuazioni di thread quando si utilizzano i modelli di programmazione asincrona di .NET Task o async/await.An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

TransactionScope(Transaction, TimeSpan) TransactionScope(Transaction, TimeSpan) TransactionScope(Transaction, TimeSpan) TransactionScope(Transaction, TimeSpan)

Inizializza una nuova istanza della classe TransactionScope con il valore di timeout specificato e imposta la transazione specificata come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.Initializes a new instance of the TransactionScope class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

public:
 TransactionScope(System::Transactions::Transaction ^ transaction, TimeSpan timeout);
public TransactionScope (System.Transactions.Transaction transaction, TimeSpan timeout);
new System.Transactions.TransactionScope : System.Transactions.Transaction * TimeSpan -> System.Transactions.TransactionScope
Public Sub New (transactionToUse As Transaction, scopeTimeout As TimeSpan)

Parametri

transactionToUse
Transaction Transaction Transaction Transaction

Transazione da impostare come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.

scopeTimeout
TimeSpan TimeSpan TimeSpan TimeSpan

TimeSpan dopo cui si verifica il timeout dell'ambito della transazione e l'interruzione della transazione.The TimeSpan after which the transaction scope times out and aborts the transaction.

Vedi anche

TransactionScope(TransactionScopeOption, TimeSpan) TransactionScope(TransactionScopeOption, TimeSpan) TransactionScope(TransactionScopeOption, TimeSpan) TransactionScope(TransactionScopeOption, TimeSpan)

Inizializza una nuova istanza della classe TransactionScope con il valore di timeout e i requisiti specificati.Initializes a new instance of the TransactionScope class with the specified timeout value and requirements.

public:
 TransactionScope(System::Transactions::TransactionScopeOption option, TimeSpan timeout);
public TransactionScope (System.Transactions.TransactionScopeOption option, TimeSpan timeout);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * TimeSpan -> System.Transactions.TransactionScope
Public Sub New (option As TransactionScopeOption, timeout As TimeSpan)

Parametri

scopeOption
TransactionScopeOption TransactionScopeOption TransactionScopeOption TransactionScopeOption

Istanza dell'enumerazione TransactionScopeOption che descrive i requisiti della transazione associati al relativo ambito.An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

scopeTimeout
TimeSpan TimeSpan TimeSpan TimeSpan

TimeSpan dopo cui si verifica il timeout dell'ambito della transazione e l'interruzione della transazione.The TimeSpan after which the transaction scope times out and aborts the transaction.

Vedi anche

TransactionScope(TransactionScopeOption, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TransactionScopeAsyncFlowOption)

Inizializza una nuova istanza della classe TransactionScope con i requisiti e le opzioni del flusso asincrono specificati.Initializes a new instance of the TransactionScope class with the specified requirements and asynchronous flow option.

public:
 TransactionScope(System::Transactions::TransactionScopeOption option, System::Transactions::TransactionScopeAsyncFlowOption asyncFlow);
public TransactionScope (System.Transactions.TransactionScopeOption option, System.Transactions.TransactionScopeAsyncFlowOption asyncFlow);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope
Public Sub New (option As TransactionScopeOption, asyncFlow As TransactionScopeAsyncFlowOption)

Parametri

scopeOption
TransactionScopeOption TransactionScopeOption TransactionScopeOption TransactionScopeOption

Istanza dell'enumerazione TransactionScopeOption che descrive i requisiti della transazione associati al relativo ambito.An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

asyncFlowOption
TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption

Un'istanza dell'enumerazione TransactionScopeAsyncFlowOption che descrive se la transazione di ambiente associata all'ambito della transazione passerà attraverso le continuazioni di thread quando si utilizzano i modelli di programmazione asincrona di .NET Task o async/await.An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

TransactionScope(TransactionScopeOption, TransactionOptions, EnterpriseServicesInteropOption) TransactionScope(TransactionScopeOption, TransactionOptions, EnterpriseServicesInteropOption) TransactionScope(TransactionScopeOption, TransactionOptions, EnterpriseServicesInteropOption) TransactionScope(TransactionScopeOption, TransactionOptions, EnterpriseServicesInteropOption)

Inizializza una nuova istanza della classe TransactionScope con l'ambito e i requisiti di interoperabilità COM+ specificati e le opzioni di transazione.Initializes a new instance of the TransactionScope class with the specified scope and COM+ interoperability requirements, and transaction options.

public:
 TransactionScope(System::Transactions::TransactionScopeOption scopeOption, System::Transactions::TransactionOptions options, System::Transactions::EnterpriseServicesInteropOption opt);
public TransactionScope (System.Transactions.TransactionScopeOption scopeOption, System.Transactions.TransactionOptions options, System.Transactions.EnterpriseServicesInteropOption opt);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * System.Transactions.TransactionOptions * System.Transactions.EnterpriseServicesInteropOption -> System.Transactions.TransactionScope
Public Sub New (scopeOption As TransactionScopeOption, options As TransactionOptions, opt As EnterpriseServicesInteropOption)

Parametri

scopeOption
TransactionScopeOption TransactionScopeOption TransactionScopeOption TransactionScopeOption

Istanza dell'enumerazione TransactionScopeOption che descrive i requisiti della transazione associati al relativo ambito.An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

transactionOptions
TransactionOptions TransactionOptions TransactionOptions TransactionOptions

Struttura TransactionOptions in cui sono descritte le opzioni di transazione da utilizzare se si crea una nuova transazione.A TransactionOptions structure that describes the transaction options to use if a new transaction is created. Se si utilizza una transazione esistente, il valore di timeout in questo parametro si applica all'ambito della transazione.If an existing transaction is used, the timeout value in this parameter applies to the transaction scope. Se il tempo scade prima dell'eliminazione dell'ambito, la transazione viene interrotta.If that time expires before the scope is disposed, the transaction is aborted.

interopOption
EnterpriseServicesInteropOption EnterpriseServicesInteropOption EnterpriseServicesInteropOption EnterpriseServicesInteropOption

Istanza dell'enumerazione EnterpriseServicesInteropOption in cui è descritta la modalità di interazione tra la transazione associata e le transazioni COM+.An instance of the EnterpriseServicesInteropOption enumeration that describes how the associated transaction interacts with COM+ transactions.

Commenti

Quando si utilizza il transactionOptions parametro per specificare un IsolationLeveloggetto e l'ambito crea una transazione in un secondo momento, la nuova transazione viene associata al livello di isolamento specificato.When you use the transactionOptions parameter to specify an IsolationLevel, and the scope creates a transaction later, the new transaction is associated with the specified isolation level. Se un livello di isolamento viene passato insieme a una transazione, è necessario che la transazione disponga di un livello di isolamento identico o che venga generata un'eccezione.If an isolation level is passed in together with a transaction, the transaction must have an identical isolation level, or an exception is thrown.

Nota Questo metodo usa LinkDemand per impedire che venga chiamato da codice non attendibile; tuttavia, è necessario solo il chiamante immediato per possedere il FullTrust set di autorizzazioni.Note This method uses LinkDemand to prevent it from being called from untrusted code; however, only the immediate caller is required to possess the FullTrust permission set.

Vedi anche

TransactionScope(Transaction, TimeSpan, EnterpriseServicesInteropOption) TransactionScope(Transaction, TimeSpan, EnterpriseServicesInteropOption) TransactionScope(Transaction, TimeSpan, EnterpriseServicesInteropOption) TransactionScope(Transaction, TimeSpan, EnterpriseServicesInteropOption)

Inizializza una nuova istanza della classe TransactionScope con il valore di timeout e i requisiti di interoperabilità COM+ specificati e imposta la transazione specificata come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.Initializes a new instance of the TransactionScope class with the specified timeout value and COM+ interoperability requirements, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.

public:
 TransactionScope(System::Transactions::Transaction ^ transaction, TimeSpan timeout, System::Transactions::EnterpriseServicesInteropOption opt);
public TransactionScope (System.Transactions.Transaction transaction, TimeSpan timeout, System.Transactions.EnterpriseServicesInteropOption opt);
new System.Transactions.TransactionScope : System.Transactions.Transaction * TimeSpan * System.Transactions.EnterpriseServicesInteropOption -> System.Transactions.TransactionScope
Public Sub New (transactionToUse As Transaction, scopeTimeout As TimeSpan, interopOption As EnterpriseServicesInteropOption)

Parametri

transactionToUse
Transaction Transaction Transaction Transaction

Transazione da impostare come transazione di ambiente, in modo che venga utilizzata dalle operazioni transazionali effettuate all'interno dell'ambito.The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.

scopeTimeout
TimeSpan TimeSpan TimeSpan TimeSpan

TimeSpan dopo cui si verifica il timeout dell'ambito della transazione e l'interruzione della transazione.The TimeSpan after which the transaction scope times out and aborts the transaction.

interopOption
EnterpriseServicesInteropOption EnterpriseServicesInteropOption EnterpriseServicesInteropOption EnterpriseServicesInteropOption

Istanza dell'enumerazione EnterpriseServicesInteropOption in cui è descritta la modalità di interazione tra la transazione associata e le transazioni COM+.An instance of the EnterpriseServicesInteropOption enumeration that describes how the associated transaction interacts with COM+ transactions.

Commenti

Nota Questo metodo usa LinkDemand per impedire che venga chiamato da codice non attendibile; tuttavia, è necessario solo il chiamante immediato per possedere il FullTrust set di autorizzazioni.Note This method uses LinkDemand to prevent it from being called from untrusted code; however, only the immediate caller is required to possess the FullTrust permission set.

Vedi anche

TransactionScope(TransactionScopeOption, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TimeSpan, TransactionScopeAsyncFlowOption) TransactionScope(TransactionScopeOption, TimeSpan, TransactionScopeAsyncFlowOption)

Inizializza una nuova istanza della classe TransactionScope con il valore di timeout, i requisiti e le opzioni del flusso asincrono specificati.Initializes a new instance of the TransactionScope class with the specified timeout value, requirements, and asynchronous flow option.

public:
 TransactionScope(System::Transactions::TransactionScopeOption option, TimeSpan timeout, System::Transactions::TransactionScopeAsyncFlowOption asyncFlow);
public TransactionScope (System.Transactions.TransactionScopeOption option, TimeSpan timeout, System.Transactions.TransactionScopeAsyncFlowOption asyncFlow);
new System.Transactions.TransactionScope : System.Transactions.TransactionScopeOption * TimeSpan * System.Transactions.TransactionScopeAsyncFlowOption -> System.Transactions.TransactionScope
Public Sub New (option As TransactionScopeOption, timeout As TimeSpan, asyncFlow As TransactionScopeAsyncFlowOption)

Parametri

scopeOption
TransactionScopeOption TransactionScopeOption TransactionScopeOption TransactionScopeOption

Istanza dell'enumerazione TransactionScopeOption che descrive i requisiti della transazione associati al relativo ambito.An instance of the TransactionScopeOption enumeration that describes the transaction requirements associated with this transaction scope.

scopeTimeout
TimeSpan TimeSpan TimeSpan TimeSpan

TimeSpan dopo cui si verifica il timeout dell'ambito della transazione e l'interruzione della transazione.The TimeSpan after which the transaction scope times out and aborts the transaction.

asyncFlowOption
TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption TransactionScopeAsyncFlowOption

Un'istanza dell'enumerazione TransactionScopeAsyncFlowOption che descrive se la transazione di ambiente associata all'ambito della transazione passerà attraverso le continuazioni di thread quando si utilizzano i modelli di programmazione asincrona di .NET Task o async/await.An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.

Si applica a