public RemoteRuleGraphActivator(ValidationGraph graph, RemoteRuleGraph remoteGraph, BehaviorGraph behaviorGraph, IRemoteRuleQuery remotes, ITypeDescriptorCache properties) { _graph = graph; _remoteGraph = remoteGraph; _behaviorGraph = behaviorGraph; _remotes = remotes; _properties = properties; }
public static ValidationPlan For(Type type, ValidationGraph graph) { var steps = new List<ValidationStep>(); graph.Sources.Each(source => { var rules = source.RulesFor(type); if (!rules.Any()) return; steps.Add(new ValidationStep(type, source.GetType(), rules)); }); return new ValidationPlan(type, steps); }
public void SetUp() { theBehaviorGraph = BehaviorGraph.BuildFrom(r => { r.Actions.IncludeType<RemoteRuleGraphEndpoint>(); r.Import<FubuMvcValidation>(); }); theValidationGraph = ValidationGraph.BasicGraph(); theRuleGraph = new RemoteRuleGraph(); theQuery = RemoteRuleQuery.Basic(); theActivator = new RemoteRuleGraphActivator(theValidationGraph, theRuleGraph, theBehaviorGraph, theQuery, new TypeDescriptorCache()); theActivator.Activate(new IPackageInfo[0], new PackageLog()); }
public static ValidationPlan For(Type type, ValidationGraph graph) { var steps = new List <ValidationStep>(); graph.Sources.Each(source => { var rules = source.RulesFor(type); if (!rules.Any()) { return; } steps.Add(new ValidationStep(type, source.GetType(), rules)); }); return(new ValidationPlan(type, steps)); }
public ValidationRegistrationActivator(ValidationGraph graph) { _graph = graph; }
public ValidationDiagnostics(ValidationGraph graph) { _graph = graph; }
public Validator(ITypeResolver typeResolver, ValidationGraph graph, IServiceLocator services) { _typeResolver = typeResolver; _graph = graph; _services = services; }
public static IValidator BasicValidator() { return(new Validator(new TypeResolver(), ValidationGraph.BasicGraph(), new InMemoryServiceLocator())); }
void IValidationRegistration.Register(ValidationGraph graph) { _rules.Each(r => r.Register(graph.Fields)); graph.RegisterSource(this); }