Ejemplo n.º 1
0
 IEnumerable <IValidatedElement> IValidatedType.GetValidatedProperties()
 {
     foreach (PropertyInfo propertyInfo in
              ((IValidatedElement)this).TargetType.GetProperties(BindingFlags.Public | BindingFlags.Instance))
     {
         if (ValidationReflectionHelper.IsValidProperty(propertyInfo))
         {
             yield return(new ValidationAttributeValidatedElement(propertyInfo));
         }
     }
 }
Ejemplo n.º 2
0
        IEnumerable <IValidatedElement> IValidatedType.GetValidatedProperties()
        {
            var flyweight = new MetadataValidatedElement(Ruleset);

            foreach (PropertyInfo propertyInfo in TargetType.GetProperties(BindingFlags.Public | BindingFlags.Instance))
            {
                if (ValidationReflectionHelper.IsValidProperty(propertyInfo))
                {
                    flyweight.UpdateFlyweight(propertyInfo);
                    yield return(flyweight);
                }
            }
        }