Page Contents

Home > @loopback/repository > CrudConnector > create

CrudConnector.create() method

Create a new entity

Signature:

create(modelClass: Class<Entity>, entity: EntityData, options?: Options): Promise<EntityData>;

Parameters

Parameter Type Description
modelClass Class<Entity> The model class
entity EntityData The entity instance or data
options Options Options for the operation

Returns:

Promise<EntityData>

A promise of the entity created