예제 #1
0
        public bool Validate(ValidatableObject <T> caller = null)
        {
            Errors.Clear();

            IEnumerable <string> currentErrors = Validations.Where(x => !x.Check(Value)).Select(x => x.ValidationMessage);

            Errors  = currentErrors.ToList();
            IsValid = !currentErrors.Any();

            foreach (var dependent in Dependents)
            {
                if (caller == null || dependent != caller)
                {
                    dependent.Validate(this);
                }
            }

            return(IsValid);
        }
예제 #2
0
 public NameValidation(ref ValidatableObject <T> otherName)
 {
     _otherName = otherName;
 }