Skip to content

v4.0.63

Choose a tag to compare

@JonathanMagnan JonathanMagnan released this 18 Nov 18:58
· 3 commits to master since this release
3addeba

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