Page Contents
Home > @loopback/repository > DefaultCrudRepository > ensurePersistable
DefaultCrudRepository.ensurePersistable() method
Converts an entity object to a JSON object to check if it contains navigational property. Throws an error if entity
contains navigational property.
Signature:
protected ensurePersistable<R extends T>(entity: R | DataObject<R>, options?: {}): legacy.ModelData<legacy.PersistedModel>;
Parameters
Parameter | Type | Description |
---|---|---|
entity | R | DataObject<R> | The entity passed from CRUD operations’ caller. |
options | {} |
Returns:
legacy.ModelData<legacy.PersistedModel>