You need to provide some classes and decorators yourself to maintain the same style as [email protected].
@EntityRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}↓
@CustomRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}@Module({
exports: [UserService],
imports: [TypeOrmModule.forFeature([UserRepository])],
providers: [UserService],
})
export class UserModule {}↓
@Module({
exports: [UserService],
imports: [TypeOrmExModule.forCustomRepository([UserRepository])],
providers: [UserService],
})
export class UserModule {}
Add the Repository to the module providers as you would with the service.
e.g
Here is my setup.
user.respository.tsuser.module.tsNow, I need it in my auth module.
auth.module.tsUsing it in my auth service.
auth.service.ts