We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87f7d8c commit 3656eafCopy full SHA for 3656eaf
src/mikro-orm.providers.ts
@@ -9,6 +9,14 @@ export function createMikroOrmProvider(
9
contextName?: string,
10
type: Type = MikroORM,
11
): Provider {
12
+ if (!contextName && type !== MikroORM) {
13
+ return {
14
+ provide: type,
15
+ useFactory: orm => orm, // just a simple alias
16
+ inject: [MikroORM], // depend on the ORM from core package
17
+ };
18
+ }
19
+
20
return {
21
provide: contextName ? getMikroORMToken(contextName) : type,
22
useFactory: async (options?: MikroOrmModuleOptions) => {
0 commit comments