Language

DatabaseFacade.AutoTransactionsEnabled プロパティ

定義

注意事項

Use AutoTransactionBehavior instead

注意事項

Use EnableAutoTransactions instead

'BeginTransaction' メソッドまたは 'UseTransaction' メソッドが呼び出されていない場合に、トランザクションが SaveChanges() によって自動的に作成されるかどうかを示す値を取得または設定します。

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

プロパティ値

属性

注釈

この値を false に設定すると IExecutionStrategy 、 SaveChanges()

既定値は trueです。つまり、 SaveChanges() は変更を保存するときに常にトランザクションを使用します。

この値を false に設定する場合は、障害が発生した場合にデータベースが不整合な状態のままになる可能性があるため、注意して行う必要があります。

詳細と例については、「 EF Core のトランザクション 」を参照してください。

適用対象