Skip to content

Commit 0d9619f

Browse files
authored
Merge pull request #195 from bzbetty/AddTriggeredDbContextFactoryServiceProvider
Allow AddTriggeredDbContextFactory to use to the service provider
2 parents 7f3cae2 + f894084 commit 0d9619f

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)