Skip to content

Releases: zzzprojects/Eval-Expression.NET

v2.7.2

31 Jul 16:08
72b97a1

Choose a tag to compare

Download the library here

  • Monthly trial release

Trial unlocked for the current month (August)

v2.7.1

19 Jul 23:07
02b503b

Choose a tag to compare

Download the library here

  • ADDED: IsExpressionValue property to the VariableFactoryArgument. When true, a parameter will no longer be used from the value, the expression will be returned directly. This new option allows creating dictionary value on the fly.
var variables = new Dictionary<string, object>();
var eval = new EvalContext();

eval.VariableFactory = argument =>
{
    variables[argument.Name] = 2;
    argument.IsHandled = true;
    argument.IsExpressionValue = true;

    var dict = Expression.Constant(variables);
    var dictionaryItemPropertyInfo = typeof(IDictionary).GetProperty("Item", new[] { typeof(string) });
    Expression innerExpression = Expression.Property(dict, dictionaryItemPropertyInfo, Expression.Constant(argument.Name));
    argument.Value = Expression.Convert(innerExpression, typeof(int));
};

eval.Execute("x = 0; x = 6 + x;", variables);
var value = variables["x"];
var counter = variables.Count;

Trial unlocked for the current month (July)

v2.7.0

05 Jul 23:55

Choose a tag to compare

Download the library here

  • ADDED: Code Compiler now return additional information when an exception happens
  • ADDED: Using one dictionary + parameter from key now change dictionary value
  • ADDED: Using ExpandoObject + parameter from key now change ExpandoObject value
var variables = new Dictionary<string, object>();
variables.Add("x", 0);

Eval.Execute("x = 2;", variables);
var x2 = variables["x"];
dynamic expandoObject = new ExpandoObject();

expandoObject.x = 2;

Eval.Execute("x = 0;", expandoObject);
var x = expandoObject.x;

Trial unlocked for the current month (July)

v2.6.5

29 Jun 20:05

Choose a tag to compare

Download the library here

  • Monthly trial release

Trial unlocked for the current month (July)

v2.6.3

02 May 18:43
9370f52

Choose a tag to compare

Download the library here

FIXED: Issue with (??) operator not converting the right part.

var data = new Dictionary<string, double?> { { "A", 2 }, { "B", 3 }, { "C", null } };
var result = Z.Expressions.Eval.Execute<double?>("A + B + C ?? 7", data);

Trial unlocked for the current month (May)

v2.6.2

30 Apr 15:26

Choose a tag to compare

Download the library here

ADDED: Support to nullable when using directly dictionary key for a null value

var data = new Dictionary<string, double?> { { "A", 2 }, { "B", 3 }, { "C", null } };
var result = Z.Expressions.Eval.Execute<double?>("A + B + C.GetValueOrDefault(0)", data);

Trial unlocked for the current month (May)

v2.5.0

20 Mar 20:26
f3e95c8

Choose a tag to compare

Download the library here

FIXED: Issue with method overload + double type

Trial unlocked for the current month (March)

v2.4.21

20 Mar 18:30
f3e95c8

Choose a tag to compare

Download the library here

ADDED: VariableFactory event (Assign variable value on the fly)

var context = new EvalContext();

context.VariableFactory = arg =>
{
    var name = arg.Name;
    if (name == "X")
    {
        arg.Value = 2;
        arg.IsHandled = true;
    }
    else if (name == "Y")
    {
        arg.Value = 3;
        arg.IsHandled = true;
    }
};

var r = context.Execute("X + Y");

Trial unlocked for the current month (March)

v2.4.20

16 Mar 15:59
f3e95c8

Choose a tag to compare

Download the library here

ADDED: Support for implicit operator for method parameter

Trial unlocked for the current month (March)

v2.4.19

27 Feb 19:01

Choose a tag to compare

Download the library here

Trial unlocked for the current month (March)