我试图使用FluentValidation验证三个字段中只有一个具有值. RuleFor(x => x.Date1) .Must(x => !x.HasValue) .When(x => x.Date2.HasValue || x.Date3.HasValue) .WithMessage("Select only one of Date 1, Date 2 and Date 3"); 其他2个
专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]
Copyright (C)ICode9.com, All Rights Reserved.
ICode9版权所有