Releases: zzzprojects/Eval-Expression.NET
Releases · zzzprojects/Eval-Expression.NET
v4.0.71
Download the library here
- ADDED: Extension method added using
AddMethodcan now use other extension methods without having to use the variable (the call toTest111()was not working before in previous version)
var context = new EvalContext();
context.UnregisterAll();
context.RegisterType(typeof(PlayerJournal));
context.AddMethod(@"public bool Test111(this PlayerJournal pj)
{
return true;
}");
// this method was not working before
context.AddMethod(@"public bool Test222(this PlayerJournal pj)
{
return Test111();
}");
var c1 = context.Compile<Func<PlayerJournal, bool>>("Test222()");Trial unlocked until the end of February
v4.0.70
v4.0.69
v4.0.68
v4.0.67
v4.0.66
Download the library here
- ADDED: When compiling, parameters can be directly used to resolve extension methods (when not named) such as
context.AddMethod(@"public int GetLevel(this UserTest user)
{
return Level;
}");
var compiled = context.Compile<Func<UserTest, int>>("GetLevel();");
var result = compiled (user);Trial unlocked until the end of December
v4.0.65
v4.0.64
v4.0.63
Download the library here
- UPDATED: Monthly Trial Release
- FIXED: The Enumerable.Intersect seems doesn't work for IEnumberable #117
- FIXED: Issue with short circuit operator when using implicit operator with class for
||and&& - FIXED:
AddMethodwhen creating dynamically an extension methods without additional parameters - ADDED:
RegisterKeywordto let people add their own custom keyword such as:
public class Program
{
public static void Main()
{
EvalManager.DefaultContext.RegisterExtensionMethod(typeof(CustomExtensions));
EvalManager.DefaultContext.RegisterKeyword("isin", "IsIn");
var list = new List<int>() { 1, 2, 3 };
Console.WriteLine(Eval.Execute("2 isin list", new { list }));
Console.WriteLine(Eval.Execute("4 isin list", new { list }));
}
}
public static class CustomExtensions
{
public static bool IsIn<T>(this T x, List<T> list)
{
return list.Contains(x);
}
}Fiddle: https://dotnetfiddle.net/2tu9ae
Trial unlocked until the end of December