From ac46d680e97f3f4171fee75d5f6fa0a243bfe063 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 7 Sep 2022 16:38:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 194ef368f..924e9f834 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -1053,7 +1053,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common if (entity.ParentId != null) { - var question = await _dbContext.QCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => new { x.ShowOrder, x.QuestionName }).FirstOrDefaultAsync(); + var question = await _dbContext.QCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => new { x.Id, x.ShowOrder, x.QuestionName }).FirstOrDefaultAsync(); parentQuestionOrder = question?.ShowOrder; parentQuestionName = question?.QuestionName; @@ -1085,7 +1085,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common if (entity.ParentId != null) { - var question = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => new { x.ShowOrder, x.QuestionName }).FirstOrDefaultAsync(); + var question = entitys.Where(x => x.Entity.GetType() == typeof(TrialQCQuestion)).Select(t => t.Entity as TrialQCQuestion).Select(x => new { x.Id, x.ShowOrder, x.QuestionName }).FirstOrDefault(t => t.Id == entity.ParentId); + + question = question ?? await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => new { x.Id, x.ShowOrder, x.QuestionName }).FirstOrDefaultAsync(); + parentQuestionOrder = question?.ShowOrder; parentQuestionName = question?.QuestionName;