Condividi tramite


DatabaseFacade.AutoTransactionsEnabled Proprietà

Definizione

Attenzione

Use EnableAutoTransactions instead

Attenzione

Use AutoTransactionBehavior instead

Ottiene o imposta un valore che indica se una transazione verrà creata automaticamente se SaveChanges() nessuno dei metodi 'BeginTransaction' o 'UseTransaction' è stato chiamato.

public virtual bool AutoTransactionsEnabled { get; set; }
[System.Obsolete("Use EnableAutoTransactions instead")]
public virtual bool AutoTransactionsEnabled { get; set; }
[System.Obsolete("Use AutoTransactionBehavior instead")]
public virtual bool AutoTransactionsEnabled { get; set; }
member this.AutoTransactionsEnabled : bool with get, set
[<System.Obsolete("Use EnableAutoTransactions instead")>]
member this.AutoTransactionsEnabled : bool with get, set
[<System.Obsolete("Use AutoTransactionBehavior instead")>]
member this.AutoTransactionsEnabled : bool with get, set
Public Overridable Property AutoTransactionsEnabled As Boolean

Valore della proprietà

Attributi

Commenti

Impostando questo valore su false verrà disabilitato anche per IExecutionStrategySaveChanges()

Il valore predefinito è true, ovvero che SaveChanges() userà sempre una transazione durante il salvataggio delle modifiche.

L'impostazione di questo valore false su deve essere eseguita solo con attenzione, poiché il database potrebbe essere lasciato in uno stato incoerente se si verifica un errore.

Per altre informazioni ed esempi, vedere Transazioni in EF Core .

Si applica a