Skip to content

Releases: zzzprojects/Eval-Expression.NET

v4.0.71

18 Jan 16:42
3addeba

Choose a tag to compare

Download the library here

  • ADDED: Extension method added using AddMethod can now use other extension methods without having to use the variable (the call to Test111() 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

12 Jan 14:13
3addeba

Choose a tag to compare

Download the library here

  • UPDATED: Monthly Trial Release
  • FIXED: Exception: The number of generic arguments provided doesn't equal the arity of the generic type definition. #121

Trial unlocked until the end of February

v4.0.69

30 Dec 15:46
3addeba

Choose a tag to compare

Download the library here

  • ADDED: MaxLoopIteration option to allow to set a limit for the maximum loop a for, foreach, while, do while` statement can do before throwing an error (for security purpose)

Trial unlocked until the end of January

v4.0.68

15 Dec 17:29
3addeba

Choose a tag to compare

Download the library here

  • FIXED: Can not detect type #120

Trial unlocked until the end of January

v4.0.67

14 Dec 18:14
3addeba

Choose a tag to compare

Download the library here

  • UPDATED: Monthly Trial Release
  • IMPROVED: Some code improvement from v4.0.66 to support more case with the Compile method

Trial unlocked until the end of January

v4.0.66

07 Dec 17:39
3addeba

Choose a tag to compare

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

30 Nov 14:20
3addeba

Choose a tag to compare

Download the library here

  • ADDED: The AddMethod when using to create an extension method can now directly use members of the extended type such as:
context.AddMethod(@"public int GetLevel(this UserTest user)
{
    return Level;
}");

Trial unlocked until the end of December

v4.0.64

24 Nov 17:10
3addeba

Choose a tag to compare

Download the library here

  • FIXED: Eval.Tokenize throws NullReferenceException if a variable starts with _ and the next character is a number #118
  • FIXED: Exception when initializing Dictionary<string, object> #119

Trial unlocked until the end of December

v4.0.63

18 Nov 18:58
3addeba

Choose a tag to compare

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: AddMethod when creating dynamically an extension methods without additional parameters
  • ADDED: RegisterKeyword to 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

v4.0.62

09 Nov 14:05
3addeba

Choose a tag to compare

Download the library here

  • ADDED: new version with dependencies to .NET6 (No change since v4.0.61)

Trial unlocked until the end of November