fix ValidationResult问题

This commit is contained in:
2025-03-07 10:49:16 +08:00
parent d90486017e
commit 05260f3d49

View File

@@ -18,6 +18,7 @@ public class WorkGridScheduleSaveRequest : IValidatableObject
/// <summary>
/// 班次
/// </summary>
[EnumDataType(typeof(WorkGridTimePeriodEnumType))]
public WorkGridTimePeriodEnumType PeriodType { get; set; }
/// <summary>
@@ -31,7 +32,7 @@ public class WorkGridScheduleSaveRequest : IValidatableObject
var now = DateTime.Now;
if (Date.ToDateTime(new TimeOnly(0, 0)) < now.Date)
{
yield return new ValidationResult("不可编辑历史数据");
yield return new ValidationResult("不可编辑历史数据", new[] { nameof(Date) });
}
}
}