예제 #1
0
 public ValidatorBuilderBase(MemberAccessValidatorBuilderFactory memberAccessValidatorFactory,
                             ValidatorFactory validatorFactory)
 {
     _memberAccessValidatorFactory = memberAccessValidatorFactory;
     _validatorFactory             = validatorFactory;
 }
예제 #2
0
 public Validator CreateValidator(Type targetType, Type ownerType, MemberValueAccessBuilder memberValueAccessBuilder, ValidatorFactory ignored)
 {
     return(new ValidationAttributeValidator(attributes));
 }
        protected internal override Validator InnerCreateValidator(Type targetType, string ruleset, ValidatorFactory mainValidatorFactory)
        {
            if (string.IsNullOrEmpty(ruleset))
            {
                var builder = new ValidationAttributeValidatorBuilder(MemberAccessValidatorBuilderFactory.Default, mainValidatorFactory);

                return(builder.CreateValidator(targetType));
            }
            return(EmptyValidator);
        }
예제 #4
0
 protected internal abstract Validator InnerCreateValidator(Type targetType, string ruleset, ValidatorFactory mainValidatorFactory);
        protected internal override Validator InnerCreateValidator(Type targetType, string ruleset, ValidatorFactory mainValidatorFactory)
        {
            Validator validator = GetValidator(_validatorFactories.Select(f => f.InnerCreateValidator(targetType, ruleset, mainValidatorFactory)));

            return(validator);
        }
 public ValidationAttributeValidatorBuilder(MemberAccessValidatorBuilderFactory memberAccessValidatorFactory,
                                            ValidatorFactory validatorFactory) : base(memberAccessValidatorFactory, validatorFactory)
 {
 }
 public MetadataValidatorBuilder(MemberAccessValidatorBuilderFactory memberAccessValidatorFactory,
                                 ValidatorFactory validatorFactory) : base(memberAccessValidatorFactory, validatorFactory)
 {
 }