Skip to content

Commit

Permalink
Register TriggeredPooledDbContextFactory as transient
Browse files Browse the repository at this point in the history
  • Loading branch information
koenbeuk committed Aug 30, 2023
1 parent 69e5b86 commit c667972
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static IServiceCollection AddTriggeredPooledDbContextFactory<TContext>(th
serviceCollection.Replace(ServiceDescriptor.Describe(
serviceType: typeof(IDbContextFactory<TContext>),
implementationFactory: serviceProvider => ActivatorUtilities.CreateInstance(serviceProvider, triggeredFactoryType, serviceProvider.GetRequiredService(serviceDescriptor.ImplementationType), serviceProvider),
lifetime: ServiceLifetime.Scoped
lifetime: ServiceLifetime.Transient
));
}

Expand All @@ -171,7 +171,7 @@ public static IServiceCollection AddTriggeredPooledDbContextFactory<TContext>(th
serviceCollection.Replace(ServiceDescriptor.Describe(
serviceType: typeof(IDbContextFactory<TContext>),
implementationFactory: serviceProvider => ActivatorUtilities.CreateInstance(serviceProvider, triggeredFactoryType, serviceDescriptor.ImplementationFactory),
lifetime: ServiceLifetime.Scoped
lifetime: ServiceLifetime.Transient
));
}
return serviceCollection;
Expand Down

0 comments on commit c667972

Please sign in to comment.