public ScenarioDefinition() { _sources = new List <IValidationSource> { new ConfiguredValidationSource(_rules) }; var fieldSource = new PassThruFieldValidationSource(_fieldRules); _fieldRegistry = FieldRulesRegistry.Explicit(new IFieldValidationSource[] { fieldSource }); }
public ValidationGraph(IFieldRulesRegistry fieldRegistry, IEnumerable <IValidationSource> sources) { _fieldRegistry = fieldRegistry; _fieldQuery = new FieldValidationQuery(fieldRegistry); _sources.Fill(new FieldRuleSource(fieldRegistry)); _sources.Fill(new SelfValidatingClassRuleSource()); _sources.Fill(sources); _plans = new Cache <Type, ValidationPlan>(type => ValidationPlan.For(type, this)); }
public ValidationGraph(IFieldRulesRegistry fieldRegistry, IEnumerable<IValidationSource> sources) { _fieldRegistry = fieldRegistry; _fieldQuery = new FieldValidationQuery(fieldRegistry); _sources.Fill(new FieldRuleSource(fieldRegistry)); _sources.Fill(new SelfValidatingClassRuleSource()); _sources.Fill(sources); _plans = new Cache<Type, ValidationPlan>(type => ValidationPlan.For(type, this)); }
public static ValidationGraph For(IFieldRulesRegistry registry) { return(new ValidationGraph(registry, new IValidationSource[0])); }
internal void Register(IFieldRulesRegistry registration) { _accessors.Each(a => registration.Register(typeof(T), a, _ruleSource(a))); }
public FieldRuleSource(IFieldRulesRegistry registry) { _registry = registry; }
public FieldValidationQuery(IFieldRulesRegistry registry) { _registry = registry; }
void IValidationRegistration.RegisterFieldRules(IFieldRulesRegistry registry) { _innerRegistrations.Each(i => i.RegisterFieldRules(registry)); }
void IValidationRegistration.RegisterFieldRules(IFieldRulesRegistry registration) { _rules.Each(r => r.Register(registration)); }
public static ValidationGraph For(IFieldRulesRegistry registry) { return new ValidationGraph(registry, new IValidationSource[0]); }
public FieldRuleSource(IFieldRulesRegistry registry) { _registry = registry; }