Exemplo n.º 1
0
        public static LambdaExpression DslPatternExpression(this PatternBuilder builder, IEnumerable <Declaration> declarations, LambdaExpression expression)
        {
            var rewriter            = new PatternExpressionRewriter(builder.Declaration, declarations);
            var rewrittenExpression = rewriter.Rewrite(expression);

            return(rewrittenExpression);
        }
Exemplo n.º 2
0
        public static void DslConditions <TFact>(this PatternBuilder builder, IEnumerable <Declaration> declarations, params Expression <Func <TFact, bool> >[] conditions)
        {
            var rewriter = new PatternExpressionRewriter(builder.Declaration, declarations);

            foreach (var condition in conditions)
            {
                var rewrittenCondition = rewriter.Rewrite(condition);
                builder.Condition(rewrittenCondition);
            }
        }