Https://msdn.microsoft.com/en-us/library/bb397951.aspx
Expression trees represent code in a tree-like the data structure, where each node was an expression, for example, a method cal L or a binary operation such as x < Y.
You can compile and run code represented by expression trees.
This enables dynamic modification of executable code, the execution of LINQ queries in various databases, and the creation of dynamic queries.
For more information about expression trees in LINQ, see how to:use Expression trees to Build Dynamic Queries (C # and Vis UAL Basic).
Expression trees is also used in the Dynamic Language runtime (DLR) to provide interoperability between dynamic languages The. NET Framework and to enable compiler writers to emit expression trees instead of Microsoft intermediate language (MSIL).
For more information on the DLR, see Dynamic Language Runtime Overview.
You can have the C # or Visual Basic compiler create an expression tree for your based on an anonymous anonymous lambda expression,
Or you can create an expression trees manually by using the System.Linq.Expressions namespace.
Creating Expression Trees from Lambda Expressions
When a lambda expression was assigned to a variable of type expression<TDelegate>, the compiler emits issued, radiated; Publish code to build a expression tree that represents the lambda expression.
The C # and Visual Basic compilers can generate expression trees only from expression lambdas (or Single-line lambdas).
It cannot parse statement lambdas (or multi-line lambdas).
For more information on lambda expressions in C #, see Lambda Expressions (C # Programming Guide);
For Visual Basic, see Lambda Expressions (Visual Basic).
The following code examples demonstrate how to has the C # and Visual Basic compilers create an expression tree that repre Sents the lambda expression num = num < 5 (C #) or Function (num) num < 5 (Visual Basic).
expression<func<intbool5;
Expression Trees (C # and Visual Basic)