KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have this expression : Expression<Func<string, bool>> f = s => s.Length < 5; ParameterExpression p = Expression.Parameter (typeof (string), "s"); MemberExpression stringLength = Expression.Property (p, "Length"); ConstantExpression five = Expression.Constant (5); BinaryExpression comparison = Expression.LessThan (stringLength, five); Expression<Func<string, bool>> lambda= Expression.Lambda<Func<string, bool>> (comparison, p); //lets : test Func<string, bool> runnable = lambda.Compile(); Console.WriteLine (runnable ("kangaroo")); // False Console.WriteLine (runnable ("dog")); //True I want to ask about the .Compile() What does it compile ? And what is the difference between the first execution vs later executions...? Compile should be something that happens once and not happens again later .... What / How does it help me ?
Tags (comma-separated)
Save Edits
Cancel