diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/AbpDbContextConfigurationContext.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/AbpDbContextConfigurationContext.cs index b9cf4e3ceb..09153937e3 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/AbpDbContextConfigurationContext.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/AbpDbContextConfigurationContext.cs @@ -32,7 +32,8 @@ namespace Volo.Abp.EntityFrameworkCore.DependencyInjection ExistingConnection = existingConnection; DbContextOptions = new DbContextOptionsBuilder() - .UseLoggerFactory(serviceProvider.GetRequiredService()); + .UseLoggerFactory(serviceProvider.GetRequiredService()) + .UseApplicationServiceProvider(serviceProvider); } } @@ -47,13 +48,14 @@ namespace Volo.Abp.EntityFrameworkCore.DependencyInjection [CanBeNull] string connectionStringName, [CanBeNull] DbConnection existingConnection) : base( - connectionString, - serviceProvider, - connectionStringName, + connectionString, + serviceProvider, + connectionStringName, existingConnection) { base.DbContextOptions = new DbContextOptionsBuilder() - .UseLoggerFactory(serviceProvider.GetRequiredService()); + .UseLoggerFactory(serviceProvider.GetRequiredService()) + .UseApplicationServiceProvider(serviceProvider);; } } -} \ No newline at end of file +}