method IMultiTenancyService.getRepository
IMultiTenancyService.getRepository<Entity, Id = string>(
entity: string
): ITenantRepository<Entity, Id>

Create a tenant-scoped repository for the given entity type. Throws TenantNotResolvedError if no tenant is resolved.

Type Parameters

Entity
Id = string

Parameters

The current request context

entity: string

Entity name for scoping

Return Type

A tenant-scoped repository

Usage

import { type IMultiTenancyService } from "common/src/index.ts";