/// <summary> /// /// </summary> /// <param name="valueAccess"></param> /// <param name="innerValidator"></param> /// <param name="key"></param> public ValueAccessValidator(ValueAccess valueAccess, Validator innerValidator, string key) : base(string.Empty, string.Empty) { this.valueAccess = valueAccess; this.innerValidator = innerValidator; this.key = key; }
public Validator GetValidator() { if (this.compositionType == CompositionType.And) this.builderValidator = new AndCompositeValidator(this.validatorList.ToArray()); else this.builderValidator = new OrCompositeValidator(this.validatorList.ToArray()); this.builderValidator.MessageTemplate = this.messageTemplate; return this.builderValidator; }
internal void AddValueValidator(Validator valueValidator) { this.validatorList.Add(valueValidator); }
/// <summary> /// ObjectCollectionValidator的构造函数 /// </summary> /// <param name="targetType">目标类型</param> /// <param name="targetRuleset">所校验类型所属的校验规则集</param> public ObjectCollectionValidator(Type targetType, string targetRuleset) { this.targetType = targetType; this.targetRuleset = targetRuleset; this.targetTypeValidator = ValidationFactory.CreateValidator(targetType, targetRuleset); }
/// <summary> /// ObjectCollectionValidator的构造函数 /// </summary> /// <param name="targetType">目标类型</param> /// <param name="targetRuleset">所校验类型所属的校验规则集</param> public ObjectCollectionValidator(Type targetType, string targetRuleset) { this.targetType = targetType; this.targetRuleset = targetRuleset; this.targetTypeValidator = ValidationFactory.CreateValidator(targetType, targetRuleset); }