Example #1
0
        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            var valueToString = (string)value;

            return((valueToString != null && valueToString.Any(c => charactersNotAllowed.Contains(c)))
        ? new ValidationResult(ValidationMessages.CharactersValidatorMessage(charactersNotAllowed))
        : ValidationResult.Success);
        }