修复abp的bug的demo

This commit is contained in:
xuejiaming 2023-02-14 18:01:55 +08:00
parent 7373763e9f
commit fc0781a313
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ namespace Samples.AbpSharding
if (dbContext is AbpDbContext<TDbContext> abpDbContext && abpDbContext.LazyServiceProvider == null)
{
abpDbContext.LazyServiceProvider = this.LazyServiceProvider;
if (dbContext is IAbpEfCoreDbContext abpEfCoreDbContext)
if (dbContext is IAbpEfCoreDbContext abpEfCoreDbContext&&this.UnitOfWorkManager.Current!=null)
{
abpEfCoreDbContext.Initialize(
new AbpEfCoreDbContextInitializationContext(