From 714c136d1271b2c111c06869ca551d0572d7e5d0 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 27 Apr 2022 13:53:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs | 4 ++-- IRaCIS.Core.Infra.EFCore/Repository/Repository.cs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs index 131c3e1b3..4d83fe746 100644 --- a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs @@ -61,9 +61,9 @@ namespace IRaCIS.Core.Application.Contracts //父亲的序号肯定要比自己小 if (trialQCQuestionFilterSelect.Id != null) { - var selectItem = initList.FirstOrDefault(t => t.Id == trialQCQuestionFilterSelect.Id)!; + var selectItem = initList.FirstOrDefault(t => t.Id == trialQCQuestionFilterSelect.Id); - initList = initList.Where(t => t.Id != selectItem.Id && t.ShowOrder < selectItem.ShowOrder).ToList(); + initList = initList.WhereIf(selectItem!=null, t => t.Id != selectItem.Id && t.ShowOrder < selectItem.ShowOrder).ToList(); } diff --git a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs index 6071fad2e..c36193a36 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs @@ -609,7 +609,8 @@ namespace IRaCIS.Core.Infra.EFCore continue; } string Table = item.ForeignKeyTable; - string ForeignKeyValue = item.ForeignKeyValue; string ForeignKeyText = item.ForeignKeyText; + string ForeignKeyValue = item.ForeignKeyValue; + string ForeignKeyText = item.ForeignKeyText; string value = JsonDataValue[item.Key].ToString(); string para = string.Empty; string sql = string.Empty;