Skip to content

Doesn't process a IDictionary<string, object> correctly. #158

Open
@Yazwh0

Description

@Yazwh0

If trying to evaluate foo.a, I have the _evaluatevariable call bask as follows:

    private void _evaluator_EvaluateVariable(object? sender, VariableEvaluationEventArg e)
    {
        if (e.Name == "foo")
        {
            e.Value = new Dictionary<string, object>()
            {
                { "a", 1 },
            };
        }
    }

The library returns an error that the Dictionary doesn't contain a function a. It would be better if the parser could handle dictionaries correctly.

Looking as the code, I think its this line here, it seems to work if I remove the obj is IDynamicMetaObjectProvider check. I assume this is something to do with ExpendoObjects?
https://github.com/codingseb/ExpressionEvaluator/blob/master/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs#L2307

Im using .net6 btw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions