API Reference > ecschema-metadata > Context > SchemaContext SchemaContext Class Beta The SchemaContext, context object is used to facilitate schema and schema item location. The context controls the lifetime of each schema that it knows about. It has to be explicitly removed from the context to delete a schema object. The context is made up of a group of Schema Locators. Implements ISchemaLocater ISchemaItemLocater Methods Name Description constructor(): SchemaContext addLocater(locater: ISchemaLocater): void addSchema(schema: Schema): Promise<void> Adds the schema to this context addSchemaItem(schemaItem: SchemaItem): Promise<void> Adds the given SchemaItem to the the SchemaContext by locating the schema, with the best match of SchemaMatchType.Exact, and addSchemaSync(schema: Schema): void Adds the schema to this context getSchema<T extends Schema<T>>(schemaKey: SchemaKey, matchType: SchemaMatchType = SchemaMatchType.Latest): Promise<undefined | T> getSchemaItem<T extends SchemaItem<T>>(schemaItemKey: SchemaItemKey): Promise<undefined | T> getSchemaItemSync<T extends SchemaItem<T>>(schemaItemKey: SchemaItemKey): undefined | T getSchemaSync<T extends Schema<T>>(schemaKey: SchemaKey, matchType: SchemaMatchType = SchemaMatchType.Latest): undefined | T Defined in core/ecschema-metadata/src/Context.ts Line 134 Last Updated: 11 June, 2024