public override IList<ValidationRule> GetValidationRules(DataObject current, string property)
 {
     IList<ValidationRule> rules = new List<ValidationRule>();
     ValidationRule rule = new ValidationRule(GeneralAssertionTemplate.IsBusinessObjectNotNull(current, property));
     rules.Add(rule);
     return rules;
 }
 public override IList<ValidationRule> GetValidationRules(DataObject current, string property)
 {
     IList<ValidationRule> rules = new List<ValidationRule>();
     if (_maxLengthSpecified)
     {
         ValidationRule rule =
             new ValidationRule(
                 GeneralAssertionTemplate.LengthLess(current, property, MaxLength));
         rules.Add(rule);
     }
     if (_minLengthSpecified)
     {
         ValidationRule rule =
             new ValidationRule(
                 GeneralAssertionTemplate.LengthGreater(current, property, MinLength));
         rules.Add(rule);
     }
     return rules;
 }
        public override IList<ValidationRule> GetValidationRules(DataObject current, string property)
        {
            if(string.IsNullOrEmpty(regexExpression))
            {
                throw new ApplicationException(string.Format("A regex validation expression must be supplied on property {0}", property));
            }
            if(string.IsNullOrEmpty(ErrorMessage))
            {
                ErrorMessage = "{0} failed regex validation";
            }

            Regex r = new Regex(regexExpression, RegexOptions);

            IList<ValidationRule> rules = new List<ValidationRule>();
            ValidationRule rule = new ValidationRule(GeneralAssertionTemplate.Regex(current, property, r, ErrorMessage));
            rules.Add(rule);
            return rules;
        }