klyn.data.EntityManager.repository
method

    public repository<T, TId>() as Repository<T, TId>:

Description

Returns a cached typed KQL query root using the default mapping.

The compiler accepts `repository<T>()` and infers `TId` from the unique effective `@Id` property. The explicit `repository<T, TId>()` form is also supported and validates the exact mapped key type.

Parameters

Parameter | Description
--- | ---
`<T>` | Entity type.
`<TId>` | Effective identity type.

Returns

Manager-owned query repository.

Throws

- EntityMappingException when mapping metadata is invalid.

Example

    users = manager.repository<User>()
    explicitUsers = manager.repository<User, Int>()