Ejemplo n.º 1
0
        IEnumerable <IValidatedElement> IValidatedType.GetValidatedFields()
        {
            var flyweight = new MetadataValidatedElement(Ruleset);

            foreach (FieldInfo fieldInfo in TargetType.GetFields(BindingFlags.Public | BindingFlags.Instance))
            {
                flyweight.UpdateFlyweight(fieldInfo);
                yield return(flyweight);
            }
        }
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);
                }
            }
        }
Ejemplo n.º 3
0
        IEnumerable <IValidatedElement> IValidatedType.GetValidatedMethods()
        {
            var flyweight = new MetadataValidatedElement(Ruleset);

            foreach (MethodInfo methodInfo in TargetType.GetMethods(BindingFlags.Public | BindingFlags.Instance))
            {
                ParameterInfo[] parameters = methodInfo.GetParameters();

                if (ValidationReflectionHelper.IsValidMethod(methodInfo))
                {
                    flyweight.UpdateFlyweight(methodInfo);
                    yield return(flyweight);
                }
            }
        }