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