From 8130ce789ba5e4dc6d785e0a473765ceebbd3cca Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 10 Oct 2024 15:29:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(migrations):=20=E4=BF=AE=E5=A4=8D=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E6=97=B6DI=E5=AE=B9=E5=99=A8=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=94=A8(#1011)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EntityFrameworkCore/AbpDataProtectionDbContext.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs index 5f792f1ee..0a1517128 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs @@ -24,10 +24,13 @@ public abstract class AbpDataProtectionDbContext : AbpDbContext()); - //optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService()); - optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService()); + if (LazyServiceProvider != null) + { + // TODO: 需要优化表达式树 + // optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService()); + //optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService()); + optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService()); + } } protected override void ApplyAbpConceptsForAddedEntity(EntityEntry entry)