DatabaseFacade.AutoTransactionBehavior Property

Definition

Gets or sets a value indicating whether or not a transaction will be created automatically by SaveChanges() if neither 'BeginTransaction' nor 'UseTransaction' has been called.

public virtual Microsoft.EntityFrameworkCore.AutoTransactionBehavior AutoTransactionBehavior { get; set; }
member this.AutoTransactionBehavior : Microsoft.EntityFrameworkCore.AutoTransactionBehavior with get, set
Public Overridable Property AutoTransactionBehavior As AutoTransactionBehavior

Property Value

Remarks

The default setting is WhenNeeded.

Setting this to Never with caution, since the database could be left in an inconsistent state if failure occurs.

See Transactions in EF Core for more information and examples.

Applies to