- Arithmetic Operations
- Assign Expression
- Comparison Expression
- Conditional Expression
- Exception Expression
- Iteration Expression
- Jump Expression
- Logical Expression
- Member Expression
- Operators Expression
Expression Tree Tutorial Not Expression
You can build an expression tree which contains a bitwise complement operation using Expression.Not
method. For example, you have the following code.
bool value = false; Console.WriteLine(!value);
Here is the code that is required to build the same functionality using expression tree.
Expression greaterThanExpr = Expression.Not( Expression.Constant(false)); Console.WriteLine(Expression.Lambda<Func<bool>>(greaterThanExpr).Compile()());