Пример #1
0
        public void Configure(ValidatorBuilder <T> builder)
        {
            var elementBuilder = new TypeValidatorBuilder <TElement>();

            _configurator.Configure(elementBuilder);

            Validator <TElement> elementValidator = elementBuilder.Build("");

            var nestedValidator = new NestedValidator <TElement>(elementValidator);

            var validator = new EnumerableValidator <T, TElement>(nestedValidator);

            builder.AddValidator(validator);
        }
Пример #2
0
        public void Configure(ValidatorBuilder <T> builder)
        {
            var propertyValidatorBuilder = new TypeValidatorBuilder <TProperty>();

            foreach (var configurator in _configurators)
            {
                configurator.Configure(propertyValidatorBuilder);
            }

            Validator <TProperty> propertyValueValidator =
                propertyValidatorBuilder.Build("." + GetPropertyName(_propertyExpression));

            var validator = new PropertyValidator <T, TProperty>(_propertyExpression, propertyValueValidator);

            builder.AddValidator(validator);
        }
Пример #3
0
        public void Configure(ValidatorBuilder <T> builder)
        {
            var validator = new NestedValidator <T>(_nestedValidator);

            builder.AddValidator(validator);
        }
Пример #4
0
        public void Configure(ValidatorBuilder <string> builder)
        {
            var validator = new NotEmptyValidator();

            builder.AddValidator(validator);
        }
        public override void Configure(ValidatorBuilder<DateTime> builder)
        {
            var validator = new WithinPastDateTimeValidator(_period);

            builder.AddValidator(validator);
        }
Пример #6
0
        public void Configure(ValidatorBuilder <string> builder)
        {
            var validator = new MatchesValidator(_compiled);

            builder.AddValidator(validator);
        }
Пример #7
0
        public void Configure(ValidatorBuilder <IList <T> > builder)
        {
            var validator = new NotEmptyListValidator <T>();

            builder.AddValidator(validator);
        }
Пример #8
0
        public void Configure(ValidatorBuilder <string> builder)
        {
            var validator = new StringValidator(_validate, _message);

            builder.AddValidator(validator);
        }
Пример #9
0
        public override void Configure(ValidatorBuilder <DateTime> builder)
        {
            var validator = new WithinPastDateTimeValidator(_period);

            builder.AddValidator(validator);
        }
Пример #10
0
        public void Configure(ValidatorBuilder <T> builder)
        {
            var validator = new NotNullValidator <T>();

            builder.AddValidator(validator);
        }