Lingua

DatabaseFacade.AutoTransactionsEnabled Proprietà

Definizione

Attenzione

Use AutoTransactionBehavior instead

Attenzione

Use EnableAutoTransactions instead

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

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

Valore della proprietà

Attributi

Commenti

L'impostazione di questo valore su false disabiliterà anche per IExecutionStrategySaveChanges()

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

L'impostazione di questo valore su false deve essere eseguita con cautela, poiché il database potrebbe essere lasciato in uno stato incoerente in caso di errore.

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

Si applica a