数据库可插入null
continuous-integration/drone/push Build is passing Details

Test_HIR_Net8
he 2025-09-28 12:46:35 +08:00
parent a436571364
commit a7ed38f03b
3 changed files with 5 additions and 3 deletions

View File

@ -933,7 +933,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
needAddList.Add(new ReadingTaskQuestionAnswer()
{
Answer = item.Answer,
PCWGInterimAnswer=null,
ReadingQuestionTrialId = item.QuestionId,
});
}

View File

@ -38,5 +38,5 @@ public class ReadingTaskQuestionAnswer : BaseAddAuditEntity
/// <summary>
/// PCWG 临时Answer
/// </summary>
public string? PCWGInterimAnswer { get; set; } = null;
public string? PCWGInterimAnswer { get; set; }
}

View File

@ -87,12 +87,14 @@ public class AuditEntityInterceptor(IUserInfo _userInfo,
//}
// 检查属性是否为string类型并且值为null
foreach (var property in entry.Properties.Where(t => t.Metadata.ClrType == typeof(string) && t.CurrentValue == null))
foreach (var property in entry.Properties.Where(t => t.Metadata.ClrType == typeof(string) && !t.Metadata.IsNullable && t.CurrentValue == null))
{
property.CurrentValue = string.Empty;
}
switch (entry.State)
{