Skip to content

Commit f894084

Browse files
committed
Allow AddTriggeredDbContextFactory to use to the service provider
1 parent 7f3cae2 commit f894084

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/EntityFrameworkCore.Triggered/Extensions/ServiceCollectionExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ public static IServiceCollection AddTriggeredDbContextPool<TContext, TImplementa
7676
return serviceCollection;
7777
}
7878

79-
public static IServiceCollection AddTriggeredDbContextFactory<TContext>(this IServiceCollection serviceCollection, Action<DbContextOptionsBuilder>? optionsAction = null, ServiceLifetime lifetime = ServiceLifetime.Singleton)
79+
public static IServiceCollection AddTriggeredDbContextFactory<TContext>(this IServiceCollection serviceCollection, Action<IServiceProvider, DbContextOptionsBuilder>? optionsAction = null, ServiceLifetime lifetime = ServiceLifetime.Singleton)
8080
where TContext : DbContext
8181
{
82-
serviceCollection.AddDbContextFactory<TContext>(options => {
83-
optionsAction?.Invoke(options);
82+
serviceCollection.AddDbContextFactory<TContext>((serviceProvider, options) => {
83+
optionsAction?.Invoke(serviceProvider, options);
8484
options.UseTriggers();
8585
}, lifetime);
8686

0 commit comments

Comments
 (0)