EntityDAC

TEntity.Create Constructor

The constructor is designed for creating a new entity instance.

Class

TEntity

Syntax

constructor Create; overload; virtual;

Remarks

The method creates a new entity instance. The entity attributes forming the primary key will be initialized by the default values. The entity instance created by this method is not attached to the data context (is not placed to the object cache), therefore it won't be automatically destroyed on application shutdown. It should be destroyed manually. It is expedient to use the method in case when the primary key value of an entity is unknown at the moment of its creation (or there is no confidence in its uniqueness), in order to avoid an exception on an attempt to place an object to the cache.

To attach an entity instance to the data context and place it to the object cache, the TCustomEntityContext.Attach method should be used.

The method is the analogue of the TCustomEntityContext.CreateEntity method.

See Also

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