Skip to content

Commit

Permalink
Merge pull request #185 from koenbeuk/issue-176
Browse files Browse the repository at this point in the history
Register TriggeredPooledDbContextFactory as transient
  • Loading branch information
koenbeuk authored Aug 30, 2023
2 parents 69e5b86 + c667972 commit 7f3cae2
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 7f3cae2

Please sign in to comment.