public void SetUp()
        {
            theRegistry = new FieldRulesRegistry(new [] { new AttributeFieldValidationSource()},
                                                 new TypeDescriptorCache());

            theRules = theRegistry.RulesFor<AttributeScanningTarget>();
        }
        public void SetUp()
        {
            theRegistry = new FieldRulesRegistry(new [] { new AttributeFieldValidationSource() },
                                                 new TypeDescriptorCache());

            theRules = theRegistry.RulesFor <AttributeScanningTarget>();
        }
Пример #3
0
        private IEnumerable <IFieldValidationRule> rulesFor(Expression <Func <ClassValidationRulesTarget, object> > expression)
        {
            var registry = new FieldRulesRegistry(new IFieldValidationSource[0], new TypeDescriptorCache());

            registry.Import(theRules);

            return(registry.RulesFor(typeof(ClassValidationRulesTarget)).RulesFor(expression.ToAccessor()));
        }
Пример #4
0
        private IEnumerable <IFieldValidationRule> rulesFor(Expression <Func <ValidationRegistryTarget, object> > expression)
        {
            var registry = new FieldRulesRegistry(TypeExtensions.As <IValidationRegistration>(theRegistry).FieldSources(), new TypeDescriptorCache());

            TypeExtensions.As <IValidationRegistration>(theRegistry).RegisterFieldRules(registry);

            return(registry.RulesFor <ValidationRegistryTarget>(expression));
        }
Пример #5
0
        private IEnumerable <IFieldValidationRule> rulesFor(Expression <Func <FieldAccessRuleRegistryTarget, object> > property)
        {
            var rules = theRegistry.RulesFor <FieldAccessRuleRegistryTarget>();

            return(rules.RulesFor(property.ToAccessor()));
        }
        private IEnumerable<IFieldValidationRule> rulesFor(Expression<Func<ClassValidationRulesTarget, object>> expression)
        {
            var registry = new FieldRulesRegistry(new IFieldValidationSource[0], new TypeDescriptorCache());
            registry.Import(theRules);

            return registry.RulesFor(typeof (ClassValidationRulesTarget)).RulesFor(expression.ToAccessor());
        }
 private IEnumerable<IFieldValidationRule> rulesFor(Expression<Func<LambdaFieldValidationSourceTarget, object>> expression)
 {
     var registry = new FieldRulesRegistry(new IFieldValidationSource[]{theSource}, new TypeDescriptorCache());
     return registry.RulesFor<LambdaFieldValidationSourceTarget>(expression);
 }
Пример #8
0
        private IEnumerable <IFieldValidationRule> rulesFor(Expression <Func <LambdaFieldValidationSourceTarget, object> > expression)
        {
            var registry = new FieldRulesRegistry(new IFieldValidationSource[] { theSource }, new TypeDescriptorCache());

            return(registry.RulesFor <LambdaFieldValidationSourceTarget>(expression));
        }
        private IEnumerable<IFieldValidationRule> rulesFor(Expression<Func<ValidationRegistryTarget, object>> expression)
        {
            var registry = new FieldRulesRegistry(TypeExtensions.As<IValidationRegistration>(theRegistry).FieldSources(), new TypeDescriptorCache());
            TypeExtensions.As<IValidationRegistration>(theRegistry).RegisterFieldRules(registry);

            return registry.RulesFor<ValidationRegistryTarget>(expression);
        }