예제 #1
0
        public bool LengthEqualTo_IsValid(string propertyValue, int length)
        {
            //Create Validator
            var validator = new LengthEqualTo <Contact>(length);
            RuleValidatorContext <Contact, string> context = BuildContextForLength(propertyValue);

            var notification = new ValidationNotification();

            //Validate the validator only, return true of no error returned
            return(validator.Validate(context, null, notification));
        }
예제 #2
0
        public bool LengthEqualTo_IsValid(string propertyValue, int length)
        {
            //Create Validator
            var validator = new LengthEqualTo<Contact>(length);
            RuleValidatorContext<Contact, string> context = BuildContextForLength(propertyValue);

            var notification = new ValidationNotification();

            //Validate the validator only, return true of no error returned
            return validator.Validate(context, null, notification);
        }