EntityDAC

TCustomEntityContext.Cancel Method

The method is designed to cancel changes made in an entity instance.

Class

TCustomEntityContext

Syntax

procedure Cancel(Entity: TMappedEntity; Cascade: boolean = False);

Parameters
Entity
The entity instance whose changes have to be cancelled.
Cascade
The parameter defines whether to perform cascade cancel of modidications of entity references and linked collections when canceling the entity modifications. The default value is False.

Remarks

The method cancels modifications made in an entity instance. If an instance was deleted with TCustomEntityContext.Delete, the entity is restored from the object cache on the method execution, database access doesn't occur. The method cancels only those changes, that were not saved with the TCustomEntityContext.Save or TDataContext.SubmitChanges methods.

To cancel changes for all entities attached to the data context, the TDataContext.RejectChanges method is used.

See Also

© 1997-2024 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback