getModel Method

Get the Model with the specified identifier.

getModel<T extends Model<T>>(modelId: string, modelClass?: EntityClassType<Model>): T

@throws IModelError if the model is not found, cannot be loaded, or fails validation when modelClass is specified.

@see IModelDb.Models.tryGetModel

Parameter Type Description
modelId string The Model identifier.
modelClass EntityClassType<Model> Optional class to validate instance against. This parameter can accept abstract or concrete classes, but should be the same as the template (T) parameter.

Returns - T

Defined in

Last Updated: 25 April, 2024