private void UpdateFlyweight(MemberInfo memberInfo, Type targetType)
 {
     this.memberInfo                    = memberInfo;
     this.targetType                    = targetType;
     this.ignoreNullsAttribute          = ValidationReflectionHelper.ExtractValidationAttribute <IgnoreNullsAttribute>(memberInfo, this.ruleset);
     this.validatorCompositionAttribute = ValidationReflectionHelper.ExtractValidationAttribute <ValidatorCompositionAttribute>(memberInfo, this.ruleset);
 }
Beispiel #2
0
        IEnumerable <IValidatedElement> IValidatedType.GetValidatedProperties()
        {
            MetadataValidatedElement iteratorVariable0 = new MetadataValidatedElement(this.Ruleset);

            foreach (PropertyInfo iteratorVariable1 in this.TargetType.GetProperties(BindingFlags.Public | BindingFlags.Instance))
            {
                if (ValidationReflectionHelper.IsValidProperty(iteratorVariable1))
                {
                    iteratorVariable0.UpdateFlyweight(iteratorVariable1);
                    yield return(iteratorVariable0);
                }
            }
        }
 public void UpdateFlyweight(ParameterInfo parameterInfo)
 {
     this.parameterInfo                 = parameterInfo;
     this.ignoreNullsAttribute          = ValidationReflectionHelper.ExtractValidationAttribute <IgnoreNullsAttribute>(parameterInfo, string.Empty);
     this.validatorCompositionAttribute = ValidationReflectionHelper.ExtractValidationAttribute <ValidatorCompositionAttribute>(parameterInfo, string.Empty);
 }