Esempio 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());
        }
Esempio 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());
        }