From 2a217c1a208a261e23ea38852ee1c16e784af436 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 11 Dec 2024 19:44:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs | 7 ++++++- .../EntityConfigration/VisitTaskConfigration.cs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 92a54bfcc..3f06bddc0 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -174,6 +174,7 @@ public class IRaCISDBContext : DbContext if (navigation.IsCollection) continue; + #region 有问题 // 配置基于导航属性的软删除查询筛选器 if (typeof(ISoftDelete).IsAssignableFrom(navigation.TargetEntityType.ClrType)) { @@ -191,8 +192,12 @@ public class IRaCISDBContext : DbContext modelBuilder.Entity(clrType).HasQueryFilter(filterNav); - //Console.WriteLine($"实体应用软删除:{entityType.ClrType.Name} 导航属性{filterNav}"); + Console.WriteLine($"实体应用软删除:{entityType.ClrType.Name} 导航属性{filterNav}"); } + + #endregion + + } if (typeof(Entity).IsAssignableFrom(entityType.ClrType)) diff --git a/IRaCIS.Core.Infra.EFCore/EntityConfigration/VisitTaskConfigration.cs b/IRaCIS.Core.Infra.EFCore/EntityConfigration/VisitTaskConfigration.cs index c3d486497..c592a9fbb 100644 --- a/IRaCIS.Core.Infra.EFCore/EntityConfigration/VisitTaskConfigration.cs +++ b/IRaCIS.Core.Infra.EFCore/EntityConfigration/VisitTaskConfigration.cs @@ -21,7 +21,7 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration //对于全局修改的任务而言,会关联多个全局访视阅片结果(因为同一个访视结果,会被多个全局修改) //subject 删除了,但是任务没删除,导致的查询问题 - //builder.HasQueryFilter(b => b.Subject.IsDeleted == false); + builder.HasQueryFilter(b => b.Subject.IsDeleted == false); } }