namespace Yw.Application.Health
{
///
/// 人工评价
///
public class HandEvaluation : Model.JsonModel, IValidatableObject
{
///
/// 子项列表
///
[Required]
public List Items { get; set; }
///
///
///
public IEnumerable Validate(ValidationContext validationContext)
{
if (this.Items == null || this.Items.Count < 1)
{
yield return new ValidationResult(
"Items 不能为空"
, new[] { nameof(Items) }
);
}
else if (this.Items.Exists(x => string.IsNullOrEmpty(x)))
{
yield return new ValidationResult(
"Items 存在无效项"
, new[] { nameof(Items) }
);
}
}
}
}