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); }
public BooleanExpression(ILogger logger, CalculatedParam param, MustacheConfigSchema config) { _param = param; _logger = logger; _evaluationExpression = BuildEvaluationExpression(config); }
public AnyExpression(ILogger logger, CalculatedParam param, MustacheConfigSchema schema) { _param = param; _logger = logger; _evaluationExpression = BuildEvaluationExpression(schema); }