Udostępnij za pośrednictwem


DatabaseFacade.AutoSavepointsEnabled Property

Definition

Whether a transaction savepoint will be created automatically by SaveChanges() if it is called after a transaction has been manually started with BeginTransaction().

public virtual bool AutoSavepointsEnabled { get; set; }
member this.AutoSavepointsEnabled : bool with get, set
Public Overridable Property AutoSavepointsEnabled As Boolean

Property Value

Remarks

The default value is true, meaning that SaveChanges() will create a transaction savepoint within a manually-started transaction. Regardless of this property, savepoints are only created if the data provider supports them; see SupportsSavepoints.

Setting this value to false should only be done with caution since the database could be left in a corrupted state if SaveChanges() fails.

See Transactions in EF Core for more information and examples.

Applies to