Exemple #1
0
        public string BuildLookupLambda(CalculatedParam calculatedParam, Dictionary <string, object> dataView)
        {
            var lambda = string.Empty;

            var expressionString = calculatedParam.Expression;
            var tree             = SyntaxFactory.ParseExpression(expressionString);

            foreach (var node in tree.DescendantTokens())
            {
                var key = node.ToString();
                if (dataView.ContainsKey(key))
                {
                    lambda += $"dataView[\"{key}\"]";
                }
                else
                {
                    lambda += key;
                }
            }

            return("dataView => " + lambda);
        }
Exemple #2
0
 public BooleanExpression(ILogger logger, CalculatedParam param, MustacheConfigSchema config)
 {
     _param  = param;
     _logger = logger;
     _evaluationExpression = BuildEvaluationExpression(config);
 }
Exemple #3
0
 public AnyExpression(ILogger logger, CalculatedParam param, MustacheConfigSchema schema)
 {
     _param  = param;
     _logger = logger;
     _evaluationExpression = BuildEvaluationExpression(schema);
 }