Ejemplo n.º 1
0
        public static IList <Result> Analyze <T> (T input, RuleTreeType treeType)
        {
            Debug.Assert(typeof(T) == AnalysisExtensions.GetType(treeType.Input));

            var tree = AnalysisExtensions.GetAnalysisTree(treeType);

            if (tree == null)
            {
                return(RuleTreeLeaf.Empty);
            }

            //force to analyze immediately by evaluating into a list
            return(tree.Analyze(input).ToList());
        }
Ejemplo n.º 2
0
        public static IEnumerable <Result> Analyze <T> (T input, RuleTreeType treeType, CancellationToken cancellationToken = default(CancellationToken))
        {
            Debug.Assert(typeof(T) == AnalysisExtensions.GetType(treeType.Input));

            var tree = AnalysisExtensions.GetAnalysisTree(treeType);

            if (tree == null)
            {
                return(RuleTreeLeaf.Empty);
            }

            //force to analyze immediately by evaluating into a list
            return(tree.Analyze(input, cancellationToken).ToList());
        }