Page Contents

Home > @loopback/repository > RepositoryMetadata > (constructor)

RepositoryMetadata.constructor

Constructor for RepositoryMetadata

Signature:

constructor(modelOrRepo: string | typeof Entity, dataSource?: string | juggler.DataSource | DataSource);

Parameters

Parameter Type Description
modelOrRepo string | typeof Entity Name or class of the model. If the value is a string and dataSource is not present, it will treated as the name of a predefined repository
dataSource string | juggler.DataSource | DataSource Name or instance of the data sourceFor example:- new RepositoryMetadata(repoName); - new RepositoryMetadata(modelName, dataSourceName); - new RepositoryMetadata(modelClass, dataSourceInstance); - new RepositoryMetadata(modelName, dataSourceInstance); - new RepositoryMetadata(modelClass, dataSourceName);