Jazyk

DatabaseFacade.AutoTransactionsEnabled Vlastnost

Definice

Upozornění

Use AutoTransactionBehavior instead

Upozornění

Use EnableAutoTransactions instead

Získá nebo nastaví hodnotu určující, zda transakce bude vytvořena automaticky SaveChanges() , pokud nebyla volána žádná z 'BeginTransaction' nebo 'UseTransaction' metody.

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

Hodnota vlastnosti

Atributy

Poznámky

Nastavení této hodnoty na false hodnotu bude také zakázáno IExecutionStrategy pro SaveChanges()

Výchozí hodnota je true, což znamená, že SaveChanges() při ukládání změn bude vždy používat transakci.

Nastavení této hodnoty false by mělo být provedeno pouze s opatrností, protože databáze může být ponechána v nekonzistentním stavu, pokud dojde k selhání.

Další informace a příklady najdete v tématu Transakce v EF Core .

Platí pro