private void CollectValidatorsForType(IValidatedType validatedType, List<Validator> validators) { Validator validator = CreateValidatorForValidatedElement(validatedType, this.GetCompositeValidatorBuilderForType); if (validator != null) { validators.Add(validator); } }
private void CollectValidatorsForType(IValidatedType validatedType, List <Validator> validators) { Validator validator = CreateValidatorForValidatedElement(validatedType, this.GetCompositeValidatorBuilderForType); if (validator != null) { validators.Add(validator); } }
void CollectValidatorsForType(IValidatedType validatedType, List <Validator> validators) { Validator item = this.CreateValidatorForValidatedElement(validatedType, new CompositeValidatorBuilderCreator(this.GetCompositeValidatorBuilderForType)); if (item != null) { validators.Add(item); } }
public Validator CreateValidator(IValidatedType validatedType) { List<Validator> validators = new List<Validator>(); CollectValidatorsForType(validatedType, validators); CollectValidatorsForProperties(validatedType.GetValidatedProperties(), validators); CollectValidatorsForFields(validatedType.GetValidatedFields(), validators); CollectValidatorsForMethods(validatedType.GetValidatedMethods(), validators); CollectValidatorsForSelfValidationMethods(validatedType.GetSelfValidationMethods(), validators); return new AndCompositeValidator(validators.ToArray()); }
public Validator CreateValidator(IValidatedType validatedType) { List <Validator> validators = new List <Validator>(); CollectValidatorsForType(validatedType, validators); CollectValidatorsForProperties(validatedType.GetValidatedProperties(), validators, validatedType.TargetType); CollectValidatorsForFields(validatedType.GetValidatedFields(), validators, validatedType.TargetType); CollectValidatorsForMethods(validatedType.GetValidatedMethods(), validators, validatedType.TargetType); CollectValidatorsForSelfValidationMethods(validatedType.GetSelfValidationMethods(), validators); return(new AndCompositeValidator(validators.ToArray())); }
public Validator CreateValidator(IValidatedType validatedType) { List<Validator> validators = new List<Validator>(); this.CollectValidatorsForType(validatedType, validators); this.CollectValidatorsForProperties(validatedType.GetValidatedProperties(), validators, validatedType.TargetType); this.CollectValidatorsForFields(validatedType.GetValidatedFields(), validators, validatedType.TargetType); this.CollectValidatorsForMethods(validatedType.GetValidatedMethods(), validators, validatedType.TargetType); this.CollectValidatorsForSelfValidationMethods(validatedType.GetSelfValidationMethods(), validators); if (validators.Count == 1) { return validators[0]; } return new AndCompositeValidator(validators.ToArray()); }
public Validator CreateValidator(IValidatedType validatedType) { List <Validator> list = new List <Validator>(); this.CollectValidatorsForType(validatedType, list); this.CollectValidatorsForProperties(validatedType.GetValidatedProperties(), list, validatedType.TargetType); this.CollectValidatorsForFields(validatedType.GetValidatedFields(), list, validatedType.TargetType); this.CollectValidatorsForMethods(validatedType.GetValidatedMethods(), list, validatedType.TargetType); this.CollectValidatorsForSelfValidationMethods(validatedType.GetSelfValidationMethods(), list); if (list.Count == 1) { return(list[0]); } return(new AndCompositeValidator(list.ToArray())); }
public Validator CreateValidator(IValidatedType validatedType) { var validators = new List <Validator>(); CollectValidatorsForType(validatedType, validators); CollectValidatorsForProperties(validatedType.GetValidatedProperties(), validators); CollectValidatorsForFields(validatedType.GetValidatedFields(), validators); CollectValidatorsForMethods(validatedType.GetValidatedMethods(), validators); CollectValidatorsForSelfValidationMethods(validatedType.GetSelfValidationMethods(), validators); if (validators.Count == 1) { return(validators[0]); } return(new AndCompositeValidator(validators.ToArray())); }
public void Setup() { this.validatedType = new ValidationAttributeValidatedType(typeof(TypeWithValidationAttributes)); }
void CollectValidatorsForType(IValidatedType validatedType, List<Validator> validators) { Validator item = this.CreateValidatorForValidatedElement(validatedType, new CompositeValidatorBuilderCreator(this.GetCompositeValidatorBuilderForType)); if (item != null) { validators.Add(item); } }