示例#1
0
        private bool VisitChildren(IValidationStrategy strategy)
        {
            var isValid     = true;
            var enumerator  = strategy.GetChildren(_metadata, _key, _model);
            var parentEntry = new ValidationEntry(_metadata, _key, _model);

            while (enumerator.MoveNext())
            {
                var entry    = enumerator.Current;
                var metadata = entry.Metadata;
                var key      = entry.Key;
                if (metadata.PropertyValidationFilter?.ShouldValidateEntry(entry, parentEntry) == false)
                {
                    SuppressValidation(key);
                    continue;
                }

                isValid &= Visit(metadata, key, entry.Model);
            }

            return(isValid);
        }
示例#2
0
 /// <inheritdoc />
 public bool ShouldValidateEntry(ValidationEntry entry, ValidationEntry parentEntry)
 {
     return(false);
 }