FluentValidation validate Enum value

Try the built-in IsInEnum()

RuleFor(x => x.updateIndicator).IsInEnum();

This checks if the provided enum value is within the range of your enum, if not, the validation will fail:

“‘updateIndicator’ has a range of values which does not include ‘7’.”

Leave a Comment

tech