Fluent validation with dynamic message
问题 I am trying to building custom validation with dynamic message in fluent validation library. For example : public class CreateProcessValidator : AbstractValidator<CreateProcessVM> { public CreateProcessValidator() { RuleFor(x => x.ProcessFile).Must((x,e) => IsProcessFileValid(x.ProcessFile))).WithMessage("Parse failed with error : {0}"); } public bool IsProcessFileValid(HttpPostedFileBase file) { var errorMessage = "..." // pass result to validaton message ? // logic return false; } } Is here