Evaluate lambda expression

Oct 1, 2013 at 2:08 AM
having the error: Syntax Error: unexpected token "p"

how can i achieve the following?

var context = new ExpressionContext();
            const string exp = @"Person.Any(
                        p=> p.Gender == "MALE")";

            
            context.Imports.AddType(typeof(Person));
            context.Variables["Tracks"] = new List<Person>() { new Person()
                {
                    Gender = "MALE"
                },
            new Person()
                {
                    Gender = "FEMALE"
                }};
            IDynamicExpression e = context.CompileDynamic(exp);