using System; using System.Linq; using System.Collections.Generic; using System.Collections.Concurrent; using System.Reflection; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; int factor = 3; Expression> captured = () => factor * 2; var read = captured.Compile(preferInterpretation: true); Expression> parameterized = value => value * 2; var apply = parameterized.Compile(preferInterpretation: true); Console.WriteLine($"before:{read()}"); factor = 5; Console.WriteLine($"after:{read()}"); Console.WriteLine($"input:{apply(3)}"); Console.WriteLine($"capture:{((BinaryExpression)captured.Body).Left.NodeType}");