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:

Image 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 a and b are both Int32, the BinaryExpression ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.