Browse Source
Merge pull request #7996 from abpframework/maliming/UseApplicationServiceProvider
Use application service provider in AbpDbContextConfigurationContext
pull/8081/head
Halil İbrahim Kalkan
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
6 deletions
-
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<ILoggerFactory>()); |
|
|
|
.UseLoggerFactory(serviceProvider.GetRequiredService<ILoggerFactory>()) |
|
|
|
.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<TDbContext>() |
|
|
|
.UseLoggerFactory(serviceProvider.GetRequiredService<ILoggerFactory>()); |
|
|
|
.UseLoggerFactory(serviceProvider.GetRequiredService<ILoggerFactory>()) |
|
|
|
.UseApplicationServiceProvider(serviceProvider);; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|