The Expression Tree API
The main purpose of expression trees is to allow the inspection of user-written code at runtime, through the object model provided for them in
System.Linq.Expressions. In this section, we take a look at the API for those expressions.
Expression Base Class
At the root of the class hierarchy of the expression tree object model is the
Expression abstract base class. From a data point of view, it has a few properties:
Type indicates the runtime type represented by the node in the tree. Every node in an expression tree has a type that may be derived from its children. For example, if
b are both