Page Contents

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


Constructor for RepositoryMetadata


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


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 <p>(Optional) Name or instance of the data source</p><p>For example:</p><p>- new RepositoryMetadata(repoName); - new RepositoryMetadata(modelName, dataSourceName); - new RepositoryMetadata(modelClass, dataSourceInstance); - new RepositoryMetadata(modelName, dataSourceInstance); - new RepositoryMetadata(modelClass, dataSourceName);</p>