public RemoteRuleGraphActivator(ValidationGraph graph, RemoteRuleGraph remoteGraph, BehaviorGraph behaviorGraph, IRemoteRuleQuery remotes, ITypeDescriptorCache properties)
 {
     _graph = graph;
     _remoteGraph = remoteGraph;
     _behaviorGraph = behaviorGraph;
     _remotes = remotes;
     _properties = properties;
 }
Пример #2
0
        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());
        }
Пример #4
0
        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;
		}
Пример #7
0
 public Validator(ITypeResolver typeResolver, ValidationGraph graph, IServiceLocator services)
 {
     _typeResolver = typeResolver;
     _graph = graph;
     _services = services;
 }
Пример #8
0
 public static IValidator BasicValidator()
 {
     return(new Validator(new TypeResolver(), ValidationGraph.BasicGraph(), new InMemoryServiceLocator()));
 }
Пример #9
0
 public Validator(ITypeResolver typeResolver, ValidationGraph graph, IServiceLocator services)
 {
     _typeResolver = typeResolver;
     _graph        = graph;
     _services     = services;
 }
Пример #10
0
 void IValidationRegistration.Register(ValidationGraph graph)
 {
     _rules.Each(r => r.Register(graph.Fields));
     graph.RegisterSource(this);
 }