using System.Linq.Expressions;
using FastExpressionCompiler;
public static void Main()
public static void TestString()
var param = Expression.Parameter(typeof(Test), "x");
var predicate = Expression.Lambda<Func<Test, bool>>(
Expression.Property(param, "Id"),
Expression.Constant(2, typeof(int))
Expression.Constant(0, typeof(int))
var fn = predicate.Compile();
var ffn = predicate.CompileFast<Func<Test, bool>>();
Console.WriteLine("ERROR: ffn is null even though we used default false as parameter...it should've fall back to Expression.Compile()");
var ffnRes = ffn(entity);
Console.WriteLine("TestString(): OK!");
public int Id { get; set; }
public string Name { get; set; }