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)); }
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); }