Example #1
0
        public string ValidateProperty(IValidateable validationObject, string propertyName)
        {
            var result = ValidationConstants.NoError();

            var validationRuleResults = this.ValidationRules
                                        .Select(rule => rule.ValidateProperty(validationObject, propertyName))
                                        .Where(err => !string.IsNullOrWhiteSpace(err)).ToArray();

            if (validationRuleResults.Any())
            {
                result += string.Join(Environment.NewLine, validationRuleResults);
            }

            return(result);
        }
Example #2
0
 protected string NoError()
 {
     return(ValidationConstants.NoError());
 }