I started getting really tired of looking up the translation between the ExpressionType and concrete Expression type (they don’t match up), so I created this cheat sheet that has each ExpressionType, derived Expression type and a simple example. What’s interesting is a few are only available in VB.NET, but no one really wants non-short-circuited Or/And operators, do they? You can download the PDF version, or just view the big list in all its glory:
| ExpressionType | Type | Example |
| Add | BinaryExpression | int i = 2, j = 3;
Expression<Func<int>> example = () => i + j;
|
| AddChecked |
BinaryExpression |
int i = Int32.MaxValue, j = 1;
Expression<Func<int>> example = () => checked(i + j);
|
| And |
BinaryExpression |
Dim i As Boolean = True, j As Boolean = False
Dim sample As BLOCKED EXPRESSION => c is int;
|
This is only for C# 3.0, the .NET 4.0 list should grow quite a bit.
Posted
Jun 24 2009, 10:36 PM
by
bogardj