使用FluentValidation 8.0,我有一个Project
类验证器:
public class Project {
public Boolean Enabled { get; set; }
public List<Task> Tasks { get; set; }
}
RuleFor(x => x.Tasks)
.Must(x => x.Count() > 0)
.ForEach(y => {
y.SetValidator(z => new InlineValidator<Task> {
u => u.RuleFor(v => v.Approved)
.Must((v, c) => ???)
});
});
如何访问Enabled
的{{1}}(???)内Project
的属性Must
?