From f89408422299584f4b973e7c48e551df94400df0 Mon Sep 17 00:00:00 2001 From: Betty Date: Thu, 16 May 2024 16:13:42 +1200 Subject: [PATCH] Allow AddTriggeredDbContextFactory to use to the service provider --- .../Extensions/ServiceCollectionExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EntityFrameworkCore.Triggered/Extensions/ServiceCollectionExtensions.cs b/src/EntityFrameworkCore.Triggered/Extensions/ServiceCollectionExtensions.cs index bde676d..6e6c94d 100644 --- a/src/EntityFrameworkCore.Triggered/Extensions/ServiceCollectionExtensions.cs +++ b/src/EntityFrameworkCore.Triggered/Extensions/ServiceCollectionExtensions.cs @@ -76,11 +76,11 @@ public static IServiceCollection AddTriggeredDbContextPool(this IServiceCollection serviceCollection, Action? optionsAction = null, ServiceLifetime lifetime = ServiceLifetime.Singleton) + public static IServiceCollection AddTriggeredDbContextFactory(this IServiceCollection serviceCollection, Action? optionsAction = null, ServiceLifetime lifetime = ServiceLifetime.Singleton) where TContext : DbContext { - serviceCollection.AddDbContextFactory(options => { - optionsAction?.Invoke(options); + serviceCollection.AddDbContextFactory((serviceProvider, options) => { + optionsAction?.Invoke(serviceProvider, options); options.UseTriggers(); }, lifetime);